Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r92432:6f2a78fc53a2
Date: 2017-09-21 17:31 +0200
http://bitbucket.org/pypy/pypy/changeset/6f2a78fc53a2/
Log: Issue #2652
Trying to give the cffi lib modules some more module-like attributes
diff --git a/pypy/module/_cffi_backend/lib_obj.py
b/pypy/module/_cffi_backend/lib_obj.py
--- a/pypy/module/_cffi_backend/lib_obj.py
+++ b/pypy/module/_cffi_backend/lib_obj.py
@@ -203,6 +203,10 @@
return self.space.gettypeobject(Module.typedef)
if is_getattr and attr == '__name__':
return self.space.newtext("%s.lib" % self.libname)
+ if is_getattr and attr == '__loader__':
+ return self.space.w_None # PyPy/CPython 3.x only
+ if is_getattr and attr == '__spec__':
+ return self.space.w_None # PyPy/CPython 3.x only
raise oefmt(self.space.w_AttributeError,
"cffi library '%s' has no function, constant "
"or global variable named '%s'",
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit