From 3a3ce59f3a832800213653ca61cc43dc35dd9e03 Mon Sep 17 00:00:00 2001 From: milde Date: Wed, 20 Jul 2011 22:12:25 +0000 Subject: [PATCH] Apply [ 3365041 ] to fix py3k unittest regressions. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7097 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- test/test_error_reporting.py | 4 ++-- test/test_functional.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/test_error_reporting.py b/test/test_error_reporting.py index 61c832096..7266d38d0 100644 --- a/test/test_error_reporting.py +++ b/test/test_error_reporting.py @@ -236,7 +236,7 @@ class SafeStringTests_locale(unittest.TestCase): except UnicodeEncodeError: try: open(u'\xfc'.encode(sys.getfilesystemencoding(), 'replace')) - except IOError: + except IOError, e: uioe = e try: os.chdir(b('\xfc')) @@ -249,7 +249,7 @@ class SafeStringTests_locale(unittest.TestCase): except UnicodeEncodeError: try: os.chdir(u'\xfc'.encode(sys.getfilesystemencoding(), 'replace')) - except OSError: + except OSError, e: uose = e # wrapped test data: wbioe = SafeString(bioe) diff --git a/test/test_functional.py b/test/test_functional.py index ee13e6add..334befe4b 100755 --- a/test/test_functional.py +++ b/test/test_functional.py @@ -175,7 +175,6 @@ expected output and check it in: f = open(expected_path, 'r') else: # samples are UTF8 encoded. 'rb' leads to errors with Python 3! f = open(expected_path, 'r', encoding='utf-8') - f = open(expected_path, 'r') # Normalize line endings: expected = '\n'.join(f.read().splitlines()) f.close() -- 2.11.4.GIT