Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
PyPy
cffi
Commits
9d86b893ad22
Commit
36f79d47
authored
Jun 26, 2015
by
Armin Rigo
Browse files
Test and fix: Python 3.5 (at least the current beta) is unhappy
with module-like objects without a '__name__'
parent
41f9e10dfdee
Changes
2
Hide whitespace changes
Inline
Side-by-side
c/lib_obj.c
View file @
9d86b893
...
...
@@ -451,6 +451,11 @@ static PyObject *lib_getattr(LibObject *lib, PyObject *name)
PyErr_Clear
();
return
_lib_dict
(
lib
);
}
/* this hack is for Python 3.5 */
if
(
strcmp
(
PyText_AsUTF8
(
name
),
"__name__"
)
==
0
)
{
PyErr_Clear
();
return
lib_repr
(
lib
);
}
return
NULL
;
}
...
...
testing/cffi1/test_recompiler.py
View file @
9d86b893
import
sys
,
os
,
py
from
cffi
import
FFI
,
VerificationError
from
cffi
import
recompiler
...
...
@@ -1079,3 +1080,4 @@ def test_import_from_lib():
assert
MYFOO
==
42
assert
hasattr
(
lib
,
'__dict__'
)
assert
lib
.
__all__
==
[
'MYFOO'
,
'mybar'
]
# but not 'myvar'
assert
lib
.
__name__
==
repr
(
lib
)
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