GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #24456 from charris/backport-24413 · numpy/numpy@64645a1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • numpy
    • _build_utils
      • gitversion.py
    • core/src/multiarray
      • compiled_base.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎numpy/_build_utils/gitversion.py‎

Copy file name to clipboardExpand all lines: numpy/_build_utils/gitversion.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
def init_version():
66
init = os.path.join(os.path.dirname(__file__), '../../pyproject.toml')
7-
data = open(init).readlines()
7+
with open(init) as fid:
8+
data = fid.readlines()
89

910
version_line = next(
1011
line for line in data if line.startswith('version =')
Collapse file

‎numpy/core/src/multiarray/compiled_base.c‎

Copy file name to clipboardExpand all lines: numpy/core/src/multiarray/compiled_base.c
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,18 @@ arr_add_docstring(PyObject *NPY_UNUSED(dummy), PyObject *const *args, Py_ssize_t
14121412
static char *msg = "already has a different docstring";
14131413

14141414
/* Don't add docstrings */
1415+
#if PY_VERSION_HEX > 0x030b0000
1416+
static long optimize = -1000;
1417+
if (optimize < 0) {
1418+
PyObject *flags = PySys_GetObject("flags"); /* borrowed object */
1419+
PyObject *level = PyObject_GetAttrString(flags, "optimize");
1420+
optimize = PyLong_AsLong(level);
1421+
Py_DECREF(level);
1422+
}
1423+
if (optimize > 1) {
1424+
#else
14151425
if (Py_OptimizeFlag > 1) {
1426+
#endif
14161427
Py_RETURN_NONE;
14171428
}
14181429

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.