diff --git a/IPython/utils/attic.py b/IPython/utils/attic.py index 52fd799..d8fb5e3 100644 --- a/IPython/utils/attic.py +++ b/IPython/utils/attic.py @@ -46,7 +46,7 @@ class EvalDict: >>> text = "python" - >>> print "%(text.capitalize())s %(number/9.0).1f rules!" % EvalDict() + >>> print("%(text.capitalize())s %(number/9.0).1f rules!" % EvalDict()) Python 2.1 rules! """ diff --git a/IPython/utils/ipstruct.py b/IPython/utils/ipstruct.py index 809c7ac..e2b3e8f 100644 --- a/IPython/utils/ipstruct.py +++ b/IPython/utils/ipstruct.py @@ -78,7 +78,7 @@ class Struct(dict): >>> try: ... s['b'] = 20 ... except KeyError: - ... print 'this is not allowed' + ... print('this is not allowed') ... this is not allowed """ @@ -103,7 +103,7 @@ class Struct(dict): >>> try: ... s.get = 10 ... except AttributeError: - ... print "you can't set a class member" + ... print("you can't set a class member") ... you can't set a class member """ @@ -139,7 +139,7 @@ class Struct(dict): >>> try: ... s.b ... except AttributeError: - ... print "I don't have that key" + ... print("I don't have that key") ... I don't have that key """ diff --git a/IPython/utils/strdispatch.py b/IPython/utils/strdispatch.py index 03709c0..d6bf510 100644 --- a/IPython/utils/strdispatch.py +++ b/IPython/utils/strdispatch.py @@ -17,7 +17,7 @@ class StrDispatch(object): >>> dis.add_s('hei',34, priority = 4) >>> dis.add_s('hei',123, priority = 2) >>> dis.add_re('h.i', 686) - >>> print list(dis.flat_matches('hei')) + >>> print(list(dis.flat_matches('hei'))) [123, 34, 686] """ diff --git a/IPython/utils/tests/test_wildcard.py b/IPython/utils/tests/test_wildcard.py index 7e407d2..ead8e06 100644 --- a/IPython/utils/tests/test_wildcard.py +++ b/IPython/utils/tests/test_wildcard.py @@ -59,9 +59,8 @@ class Tests (unittest.TestCase): ] for pat,res in tests: res.sort() - a=wildcard.list_namespace(ns,"all",pat,ignore_case=False, - show_all=False).keys() - a.sort() + a=sorted(wildcard.list_namespace(ns,"all",pat,ignore_case=False, + show_all=False).keys()) self.assertEqual(a,res) def test_case_showall(self): @@ -75,9 +74,8 @@ class Tests (unittest.TestCase): ] for pat,res in tests: res.sort() - a=wildcard.list_namespace(ns,"all",pat,ignore_case=False, - show_all=True).keys() - a.sort() + a=sorted(wildcard.list_namespace(ns,"all",pat,ignore_case=False, + show_all=True).keys()) self.assertEqual(a,res) @@ -93,9 +91,8 @@ class Tests (unittest.TestCase): ] for pat,res in tests: res.sort() - a=wildcard.list_namespace(ns,"all",pat,ignore_case=True, - show_all=False).keys() - a.sort() + a=sorted(wildcard.list_namespace(ns,"all",pat,ignore_case=True, + show_all=False).keys()) self.assertEqual(a,res) def test_nocase_showall(self): @@ -110,8 +107,8 @@ class Tests (unittest.TestCase): ] for pat,res in tests: res.sort() - a=wildcard.list_namespace(ns,"all",pat,ignore_case=True, - show_all=True).keys() + a=sorted(wildcard.list_namespace(ns,"all",pat,ignore_case=True, + show_all=True).keys()) a.sort() self.assertEqual(a,res) @@ -126,9 +123,8 @@ class Tests (unittest.TestCase): ] for pat, res in tests: res.sort() - a = wildcard.list_namespace(ns, "all", pat, ignore_case=False, - show_all=True).keys() - a.sort() + a = sorted(wildcard.list_namespace(ns, "all", pat, ignore_case=False, + show_all=True).keys()) self.assertEqual(a, res) def test_dict_dir(self):