[pygobject] pyflakes: Fix legacy print and exception usage under Python 3
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] pyflakes: Fix legacy print and exception usage under Python 3
- Date: Sat, 26 Jul 2014 01:37:27 +0000 (UTC)
commit 4941691264970b19b81d435cd58ab18ef6bac9a5
Author: Simon Feltman <sfeltman src gnome org>
Date: Fri Jul 25 18:33:15 2014 -0700
pyflakes: Fix legacy print and exception usage under Python 3
Fix print statements and legacy exception usage in examples.
https://bugzilla.gnome.org/show_bug.cgi?id=731042
examples/properties.py | 12 ++++++------
tests/runtests-windows.py | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/examples/properties.py b/examples/properties.py
index 465b3c3..4c8a20c 100644
--- a/examples/properties.py
+++ b/examples/properties.py
@@ -15,18 +15,18 @@ class MyObject(GObject.GObject):
GObject.type_register(MyObject)
-print "MyObject properties: ", list(MyObject.props)
+print("MyObject properties: ", list(MyObject.props))
obj = MyObject()
-print "obj.foo ==", obj.foo
+print("obj.foo ==", obj.foo)
obj.foo = 'spam'
-print "obj.foo = spam"
+print("obj.foo = spam")
-print "obj.foo == ", obj.foo
+print("obj.foo == ", obj.foo)
-print "obj.boolprop == ", obj.boolprop
+print("obj.boolprop == ", obj.boolprop)
-print obj.readonly
+print(obj.readonly)
obj.readonly = 'does-not-work'
diff --git a/tests/runtests-windows.py b/tests/runtests-windows.py
index 36ab9e1..f9524f4 100644
--- a/tests/runtests-windows.py
+++ b/tests/runtests-windows.py
@@ -44,8 +44,8 @@ if __name__ == '__main__':
for name in gettestnames():
try:
suite.addTest(loader.loadTestsFromName(name))
- except Exception, e:
- print 'Could not load %s: %s' % (name, e)
+ except Exception as e:
+ print('Could not load %s: %s' % (name, e))
testRunner = unittest.TextTestRunner()
testRunner.verbosity = 2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]