From b993ca621717d0a9958b4138a32fb1e3cef7f54c Mon Sep 17 00:00:00 2001 From: xrs Date: Sat, 23 Jun 2018 16:58:37 +0200 Subject: fix fs/test_gnunet_fs_psd.py.in for python3 --- src/fs/test_gnunet_fs_psd.py.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/fs') diff --git a/src/fs/test_gnunet_fs_psd.py.in b/src/fs/test_gnunet_fs_psd.py.in index 4c91c6327..906282200 100755 --- a/src/fs/test_gnunet_fs_psd.py.in +++ b/src/fs/test_gnunet_fs_psd.py.in @@ -32,10 +32,13 @@ except NameError: # Python 3.0 - 3.3 from imp import reload -# Force encoding to utf-8, as this test otherwise fails -# on some systems (see #5094). reload(sys) -sys.setdefaultencoding('utf8') + +# Force encoding to utf-8, as this test otherwise fails +# on some systems (see #5094). In Python 3+ there is no attribute +# sys.setdefaultencoding anymore. +if (3 < sys.version_info[0]): + sys.setdefaultencoding('utf8') srcdir = "../.." gnunet_pyexpect_dir = os.path.join(srcdir, "contrib/scripts") -- cgit v1.2.3