[pypy-commit] pypy py3k: base binascii.Error on ValueError
pjenvey
noreply at buildbot.pypy.org
Thu Nov 8 21:10:12 CET 2012
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r58794:aa45cb416161
Date: 2012-11-08 12:11 -0800
http://bitbucket.org/pypy/pypy/changeset/aa45cb416161/
Log: base binascii.Error on ValueError
diff --git a/pypy/module/binascii/interp_binascii.py b/pypy/module/binascii/interp_binascii.py
--- a/pypy/module/binascii/interp_binascii.py
+++ b/pypy/module/binascii/interp_binascii.py
@@ -2,7 +2,8 @@
class Cache:
def __init__(self, space):
- self.w_error = space.new_exception_class("binascii.Error")
+ self.w_error = space.new_exception_class("binascii.Error",
+ space.w_ValueError)
self.w_incomplete = space.new_exception_class("binascii.Incomplete")
def raise_Error(space, msg):
diff --git a/pypy/module/binascii/test/test_binascii.py b/pypy/module/binascii/test/test_binascii.py
--- a/pypy/module/binascii/test/test_binascii.py
+++ b/pypy/module/binascii/test/test_binascii.py
@@ -410,3 +410,6 @@
]:
assert self.binascii.unhexlify(input) == expected
assert self.binascii.a2b_hex(input) == expected
+
+ def test_error(self):
+ assert issubclass(self.binascii.Error, ValueError)
More information about the pypy-commit
mailing list