Commit b827baba authored by Jason R. Coombs's avatar Jason R. Coombs

Update exceptions for Python 3 compatibility

--HG--
branch : distribute
extra : rebase_source : 354795c0a0b8a864583f2549ce869e719be265d2
parent 67f9020e
...@@ -147,7 +147,8 @@ class TestSdistTest(unittest.TestCase): ...@@ -147,7 +147,8 @@ class TestSdistTest(unittest.TestCase):
# The manifest should be UTF-8 encoded # The manifest should be UTF-8 encoded
try: try:
u_contents = contents.decode('UTF-8') u_contents = contents.decode('UTF-8')
except UnicodeDecodeError, e: except UnicodeDecodeError:
e = sys.exc_info()[1]
self.fail(e) self.fail(e)
# The manifest should contain the UTF-8 filename # The manifest should contain the UTF-8 filename
...@@ -188,7 +189,8 @@ class TestSdistTest(unittest.TestCase): ...@@ -188,7 +189,8 @@ class TestSdistTest(unittest.TestCase):
# The manifest should be UTF-8 encoded # The manifest should be UTF-8 encoded
try: try:
contents.decode('UTF-8') contents.decode('UTF-8')
except UnicodeDecodeError, e: except UnicodeDecodeError:
e = sys.exc_info()[1]
self.fail(e) self.fail(e)
# The manifest should contain the UTF-8 filename # The manifest should contain the UTF-8 filename
...@@ -226,7 +228,8 @@ class TestSdistTest(unittest.TestCase): ...@@ -226,7 +228,8 @@ class TestSdistTest(unittest.TestCase):
# The manifest should be UTF-8 encoded # The manifest should be UTF-8 encoded
try: try:
contents.decode('UTF-8') contents.decode('UTF-8')
except UnicodeDecodeError, e: except UnicodeDecodeError:
e = sys.exc_info()[1]
self.fail(e) self.fail(e)
# The Latin-1 filename should have been skipped # The Latin-1 filename should have been skipped
...@@ -305,7 +308,8 @@ class TestSdistTest(unittest.TestCase): ...@@ -305,7 +308,8 @@ class TestSdistTest(unittest.TestCase):
try: try:
try: try:
cmd.read_manifest() cmd.read_manifest()
except UnicodeDecodeError, e: except UnicodeDecodeError:
e = sys.exc_info()[1]
self.fail(e) self.fail(e)
finally: finally:
unquiet() unquiet()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment