Author: Brian Kearns <[email protected]>
Branch: py3k
Changeset: r62163:c01b46a3cbfe
Date: 2013-03-07 03:34 -0500
http://bitbucket.org/pypy/pypy/changeset/c01b46a3cbfe/
Log: merge heads
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -295,8 +295,6 @@
"""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
diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -534,7 +534,6 @@
self.setdictscope(w_locals)
def POP_EXCEPT(self, oparg, next_instr):
- assert self.space.py3k
block = self.pop_block()
block.cleanup(self)
return
@@ -1327,14 +1326,12 @@
# 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)
diff --git a/pypy/module/imp/test/support.py b/pypy/module/imp/test/support.py
--- a/pypy/module/imp/test/support.py
+++ b/pypy/module/imp/test/support.py
@@ -10,12 +10,8 @@
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)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit