| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5627ad9 commit 8b4e216
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3848,12 +3848,6 @@ _imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file) | |||
| 3848 | 3848 | } | |
| 3849 | 3849 | ||
| 3850 | 3850 | mod = _PyImport_LoadDynamicModuleWithSpec(spec, fp); | |
| 3851 | - if (mod != NULL) { | ||
| 3852 | - /* Remember the filename as the __file__ attribute */ | ||
| 3853 | - if (PyModule_AddObjectRef(mod, "__file__", filename) < 0) { | ||
| 3854 | - PyErr_Clear(); /* Not important enough to report */ | ||
| 3855 | - } | ||
| 3856 | - } | ||
| 3857 | 3851 | ||
| 3858 | 3852 | // XXX Shouldn't this happen in the error cases too. | |
| 3859 | 3853 | if (fp) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -226,6 +226,11 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp) | |||
| 226 | 226 | } | |
| 227 | 227 | def->m_base.m_init = p0; | |
| 228 | 228 | ||
| 229 | + /* Remember the filename as the __file__ attribute */ | ||
| 230 | + if (PyModule_AddObjectRef(m, "__file__", filename) < 0) { | ||
| 231 | + PyErr_Clear(); /* Not important enough to report */ | ||
| 232 | + } | ||
| 233 | + | ||
| 229 | 234 | PyObject *modules = PyImport_GetModuleDict(); | |
| 230 | 235 | if (_PyImport_FixupExtensionObject(m, name_unicode, filename, modules) < 0) | |
| 231 | 236 | goto error; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments