[pypy-commit] pypy apptest-file: Fix MixedModule.get_applevel_name()

rlamy pypy.commits at gmail.com
Wed Mar 13 17:11:44 EDT 2019


Author: Ronan Lamy <ronan.lamy at gmail.com>
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


More information about the pypy-commit mailing list