[pypy-commit] pypy default: simplify get_module_type_name

bdkearns noreply at buildbot.pypy.org
Wed Apr 30 03:22:31 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r71083:4bb8079f8c4f
Date: 2014-04-29 21:21 -0400
http://bitbucket.org/pypy/pypy/changeset/4bb8079f8c4f/

Log:	simplify get_module_type_name

diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -490,14 +490,11 @@
     def get_module_type_name(w_self):
         space = w_self.space
         w_mod = w_self.get_module()
-        if not space.isinstance_w(w_mod, space.w_str):
-            mod = '__builtin__'
-        else:
+        if space.isinstance_w(w_mod, space.w_str):
             mod = space.str_w(w_mod)
-        if mod != '__builtin__':
-            return '%s.%s' % (mod, w_self.name)
-        else:
-            return w_self.name
+            if mod != '__builtin__':
+                return '%s.%s' % (mod, w_self.name)
+        return w_self.name
 
     def getname(w_self, space):
         name = w_self.name


More information about the pypy-commit mailing list