1. Pypy
  2. Untitled project
  3. pypy

Commits

Ronan Lamy  committed 472c03f

Simplify FlowObjSpace.import_from()

  • Participants
  • Parent commits d377f21
  • Branches less-stringly-ops

Comments (0)

Files changed (1)

File rpython/flowspace/objspace.py

View file
     def import_from(self, w_module, w_name):
         assert isinstance(w_module, Constant)
         assert isinstance(w_name, Constant)
-        # handle sys
-        if w_module in NOT_REALLY_CONST:
-            const_w = NOT_REALLY_CONST[w_module]
-            if w_name not in const_w:
-                return self.frame.do_op(op.getattr(w_module, w_name))
         try:
-            return const(getattr(w_module.value, w_name.value))
-        except AttributeError:
+            return self.getattr(w_module, w_name)
+        except FlowingError:
             exc = ImportError("cannot import name '%s'" % w_name.value)
             raise Raise(const(exc))