Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
def bar():
try:
some_call()
- print "Success!"
+ print("Success!")
except TypeError, exc:
- print "Error while handling some call: %s" % exc
+ print("Error while handling some call: %s" % exc)
sys.exit(1)
You would need to decorate it like this to have the same effect::
@catches(TypeError)
def bar():
some_call()
- print "Success!"
+ print("Success!")
If multiple exceptions need to be caught they need to be provided as a
tuple::
@catches((TypeError, AttributeError))
def bar():
some_call()
- print "Success!"
+ print("Success!")
"""
catch = catch or Exception
<Size(2.16 GB)>
>>> s.mb
<FloatMB(2211.0)>
- >>> print "Total size: %s" % s.mb
+ >>> print("Total size: %s" % s.mb)
Total size: 2211.00 MB
- >>> print "Total size: %s" % s
+ >>> print("Total size: %s" % s)
Total size: 2.16 GB
"""