Commits

Brian Kearns  committed c01b46a Merge

merge heads

  • Participants
  • Parent commits d9ffd98, e569a7d
  • Branches py3k

Comments (0)

Files changed (3)

File pypy/interpreter/baseobjspace.py

     """Base class for the interpreter-level implementations of object spaces.
     http://pypy.readthedocs.org/en/latest/objspace.html"""
 
-    py3k = True             # are we interpreting py3k bytecode?
-
     def __init__(self, config=None):
         "NOT_RPYTHON: Basic initialization of objects."
         self.fromcache = InternalSpaceCache(self).getorbuild

File pypy/interpreter/pyopcode.py

             self.setdictscope(w_locals)
 
     def POP_EXCEPT(self, oparg, next_instr):
-        assert self.space.py3k
         block = self.pop_block()
         block.cleanup(self)
         return
         # the stack setup is slightly different than in CPython:
         # instead of the traceback, we store the unroller object,
         # wrapped.
-        if frame.space.py3k:
-            # this is popped by POP_EXCEPT, which is present only in py3k
-            w_last_exception = W_OperationError(frame.last_exception)
-            w_last_exception = frame.space.wrap(w_last_exception)
-            frame.pushvalue(w_last_exception)
-            block = ExceptHandlerBlock(self.valuestackdepth,
-                                       0, frame.lastblock)
-            frame.lastblock = block
+        # this is popped by POP_EXCEPT, which is present only in py3k
+        w_last_exception = W_OperationError(frame.last_exception)
+        w_last_exception = frame.space.wrap(w_last_exception)
+        frame.pushvalue(w_last_exception)
+        block = ExceptHandlerBlock(self.valuestackdepth, 0, frame.lastblock)
+        frame.lastblock = block
         frame.pushvalue(frame.space.wrap(unroller))
         frame.pushvalue(operationerr.get_w_value(frame.space))
         frame.pushvalue(operationerr.w_type)

File pypy/module/imp/test/support.py

         if sys.platform == 'nt':
             testfn_unencodable = testfn + u"-\u5171\u0141\u2661\u0363\uDC80"
         elif sys.platform != 'darwin':
-            fsenc = sys.getfilesystemencoding()
             try:
-                '\xff'.decode(fsenc)
+                '\xff'.decode(sys.getfilesystemencoding())
             except UnicodeDecodeError:
-                w_unenc = space.call_method(space.wrapbytes('-\xff'), 'decode',
-                                            space.wrap(fsenc),
-                                            space.wrap('surrogateescape'))
-                testfn_unencodable = testfn + space.unicode_w(w_unenc)
+                testfn_unencodable = testfn + u'-\udcff'
         cls.w_testfn_unencodable = space.wrap(testfn_unencodable)