[pypy-commit] pypy py3.3: cleanup
pjenvey
noreply at buildbot.pypy.org
Sun Aug 3 22:05:29 CEST 2014
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3.3
Changeset: r72685:ea9862aff3ad
Date: 2014-08-03 13:04 -0700
http://bitbucket.org/pypy/pypy/changeset/ea9862aff3ad/
Log: cleanup
diff --git a/pypy/module/__builtin__/test/test_dir.py b/pypy/module/__builtin__/test/test_dir.py
--- a/pypy/module/__builtin__/test/test_dir.py
+++ b/pypy/module/__builtin__/test/test_dir.py
@@ -27,15 +27,12 @@
def test_dir_traceback(self):
"""Test dir() of traceback."""
- import sys
-
try:
raise IndexError
- except:
- tb_dir = dir(sys.exc_info()[2])
+ except Exception as e:
+ tb_dir = dir(e.__traceback__)
assert tb_dir == ['tb_frame', 'tb_lasti', 'tb_lineno', 'tb_next']
-
def test_dir_object_inheritance(self):
"""Dir should behave the same regardless of inheriting from object."""
class A:
diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py
--- a/pypy/module/_io/interp_textio.py
+++ b/pypy/module/_io/interp_textio.py
@@ -288,7 +288,7 @@
w_locale = space.call_method(space.builtin, '__import__',
space.wrap('locale'))
w_encoding = space.call_method(w_locale, 'getpreferredencoding',
- space.w_False)
+ space.w_False)
except OperationError as e:
# getpreferredencoding() may also raise ImportError
if not e.match(space, space.w_ImportError):
More information about the pypy-commit
mailing list