Author: Ronan Lamy <[email protected]>
Branch: apptest-file
Changeset: r96307:954d1a568c61
Date: 2019-03-13 21:11 +0000
http://bitbucket.org/pypy/pypy/changeset/954d1a568c61/

Log:    Fix MixedModule.get_applevel_name()

diff --git a/pypy/interpreter/mixedmodule.py b/pypy/interpreter/mixedmodule.py
--- a/pypy/interpreter/mixedmodule.py
+++ b/pypy/interpreter/mixedmodule.py
@@ -74,8 +74,7 @@
         if cls.applevel_name is not None:
             return cls.applevel_name
         else:
-            pkgroot = cls.__module__
-            return pkgroot.split('.')[-1]
+            return cls.__module__.split('.')[-2]
 
     def get(self, name):
         space = self.space
diff --git a/pypy/interpreter/test/test_appinterp.py 
b/pypy/interpreter/test/test_appinterp.py
--- a/pypy/interpreter/test/test_appinterp.py
+++ b/pypy/interpreter/test/test_appinterp.py
@@ -129,6 +129,7 @@
                     assert name in module.__dict__
         """)
         assert space.is_true(w_module.call('somefunc'))
+        assert Module.get_applevel_name() == 'demomixedmod'
 
     def test_whacking_at_loaders(self):
         """Some MixedModules change 'self.loaders' in __init__(), but doing
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to