fix fs/test_gnunet_fs_psd.py.in for python3
authorxrs <xrs@mail36.net>
Sat, 23 Jun 2018 14:58:37 +0000 (16:58 +0200)
committerxrs <xrs@mail36.net>
Sat, 23 Jun 2018 14:58:37 +0000 (16:58 +0200)
src/fs/test_gnunet_fs_psd.py.in

index 4c91c632746ded8d26ab712a63adf705a43a0517..906282200db45114ea965094a25e335b274e3af7 100755 (executable)
@@ -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")