summaryrefslogtreecommitdiffstats
path: root/src/tests/pyhbac-test.py
diff options
context:
space:
mode:
authorBohuslav Kabrda <bkabrda@redhat.com>2014-12-12 11:04:40 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-01-13 10:25:37 +0100
commit341a00311680a440d7f979f06c34c70d86c9367a (patch)
tree95fdcbed6ddffb50958174c42157ceecaa06ac66 /src/tests/pyhbac-test.py
parentfaae3d55e5cf416f16158d3b9f8c8fd475ac6acf (diff)
downloadsssd-341a00311680a440d7f979f06c34c70d86c9367a.tar.gz
sssd-341a00311680a440d7f979f06c34c70d86c9367a.tar.xz
sssd-341a00311680a440d7f979f06c34c70d86c9367a.zip
Python3 support in SSSD
https://fedorahosted.org/sssd/ticket/2017
Diffstat (limited to 'src/tests/pyhbac-test.py')
-rwxr-xr-xsrc/tests/pyhbac-test.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/tests/pyhbac-test.py b/src/tests/pyhbac-test.py
index c4228368a..b7f27026b 100755
--- a/src/tests/pyhbac-test.py
+++ b/src/tests/pyhbac-test.py
@@ -1,15 +1,20 @@
#!/usr/bin/python2
+from __future__ import print_function
import unittest
import sys
import os
import copy
+import sys
srcdir = os.getenv('builddir')
if not srcdir:
srcdir = "."
MODPATH = srcdir + "/.libs" #FIXME - is there a way to get this from libtool?
+if sys.version_info[0] > 2:
+ unicode = str
+
def compat_assertItemsEqual(this, expected_seq, actual_seq, msg=None):
return this.assertEqual(sorted(expected_seq), sorted(actual_seq))
@@ -37,8 +42,8 @@ class PyHbacImport(unittest.TestCase):
" Import the module and assert it comes from tree "
try:
import pyhbac
- except ImportError, e:
- print >>sys.stderr, "Could not load the pyhbac module. Please check if it is compiled"
+ except ImportError as e:
+ print("Could not load the pyhbac module. Please check if it is compiled", file=sys.stderr)
raise e
self.assertEqual(pyhbac.__file__, MODPATH + "/pyhbac.so")