Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
79226357
Commit
79226357
authored
Nov 24, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not set "__path__" attribute on non-package modules.
parent
51c75def
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
Cython/Utility/ModuleSetupCode.c
Cython/Utility/ModuleSetupCode.c
+8
-6
No files found.
Cython/Utility/ModuleSetupCode.c
View file @
79226357
...
...
@@ -944,11 +944,13 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
return
0
;
}
static
CYTHON_SMALL_CODE
int
__Pyx_copy_spec_to_module
(
PyObject
*
spec
,
PyObject
*
moddict
,
const
char
*
from_name
,
const
char
*
to_name
)
{
static
CYTHON_SMALL_CODE
int
__Pyx_copy_spec_to_module
(
PyObject
*
spec
,
PyObject
*
moddict
,
const
char
*
from_name
,
const
char
*
to_name
,
int
allow_none
)
{
PyObject
*
value
=
PyObject_GetAttrString
(
spec
,
from_name
);
int
result
=
0
;
if
(
likely
(
value
))
{
if
(
allow_none
||
value
!=
Py_None
)
{
result
=
PyDict_SetItemString
(
moddict
,
to_name
,
value
);
}
Py_DECREF
(
value
);
}
else
if
(
PyErr_ExceptionMatches
(
PyExc_AttributeError
))
{
PyErr_Clear
();
...
...
@@ -978,10 +980,10 @@ static CYTHON_SMALL_CODE PyObject* ${pymodule_create_func_cname}(PyObject *spec,
if
(
unlikely
(
!
moddict
))
goto
bad
;
// moddict is a borrowed reference
if
(
unlikely
(
__Pyx_copy_spec_to_module
(
spec
,
moddict
,
"loader"
,
"__loader__"
)
<
0
))
goto
bad
;
if
(
unlikely
(
__Pyx_copy_spec_to_module
(
spec
,
moddict
,
"origin"
,
"__file__"
)
<
0
))
goto
bad
;
if
(
unlikely
(
__Pyx_copy_spec_to_module
(
spec
,
moddict
,
"parent"
,
"__package__"
)
<
0
))
goto
bad
;
if
(
unlikely
(
__Pyx_copy_spec_to_module
(
spec
,
moddict
,
"submodule_search_locations"
,
"__path__"
)
<
0
))
goto
bad
;
if
(
unlikely
(
__Pyx_copy_spec_to_module
(
spec
,
moddict
,
"loader"
,
"__loader__"
,
1
)
<
0
))
goto
bad
;
if
(
unlikely
(
__Pyx_copy_spec_to_module
(
spec
,
moddict
,
"origin"
,
"__file__"
,
1
)
<
0
))
goto
bad
;
if
(
unlikely
(
__Pyx_copy_spec_to_module
(
spec
,
moddict
,
"parent"
,
"__package__"
,
1
)
<
0
))
goto
bad
;
if
(
unlikely
(
__Pyx_copy_spec_to_module
(
spec
,
moddict
,
"submodule_search_locations"
,
"__path__"
,
0
)
<
0
))
goto
bad
;
return
module
;
bad:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment