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 — We already know the def is okay. · python/cpython@cd4c52d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Python
    • import.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Python/import.c‎

Copy file name to clipboardExpand all lines: Python/import.c
+12-4Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ finish_singlephase_extension(PyThreadState *tstate,
12701270
PyObject *name, PyObject *modules)
12711271
{
12721272
assert(mod != NULL && PyModule_Check(mod));
1273-
assert(def == PyModule_GetDef(mod));
1273+
assert(def == _PyModule_GetDef(mod));
12741274

12751275
if (_modules_by_index_set(tstate->interp, def, mod) < 0) {
12761276
return -1;
@@ -1419,9 +1419,17 @@ create_dynamic(PyThreadState *tstate, struct _Py_ext_module_loader_info *info,
14191419
goto finally;
14201420
}
14211421

1422-
if (res.module == NULL) {
1423-
//assert(!is_singlephase(res.def));
1424-
mod = PyModule_FromDefAndSpec(res.def, spec);
1422+
mod = res.module;
1423+
res.module = NULL;
1424+
def = res.def;
1425+
assert(def != NULL);
1426+
1427+
if (mod == NULL) {
1428+
//assert(!is_singlephase(def));
1429+
mod = PyModule_FromDefAndSpec(def, spec);
1430+
if (mod == NULL) {
1431+
goto finally;
1432+
}
14251433
}
14261434
else {
14271435
assert(is_singlephase(res.def));

0 commit comments

Comments
0 (0)
You are visitor 01402520 — 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.