8000 Fix Python 3 error. · python-rope/ropemode@24bce1a · GitHub
[go: up one dir, main page]

Skip to content

Commit 24bce1a

Browse files
methanemcepl
authored andcommitted
Fix Python 3 error.
1 parent 8b86f9f commit 24bce1a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ropemode/decorators.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import print_function
12
import traceback
23

34
from rope.base import exceptions
@@ -16,7 +17,7 @@ def __call__(self, message, short=None):
1617

1718
def _show(self, message):
1819
if message is None:
19-
print message
20+
print(message)
2021
else:
2122
self.message(message)
2223

@@ -27,7 +28,7 @@ def lisphook(func):
2728
def newfunc(*args, **kwds):
2829
try:
2930
func(*args, **kwds)
30-
except Exception, e:
31+
except Exception as e:
3132
trace = str(traceback.format_exc())
3233
short = 'Ignored an exception in ropemode hook: %s' % \
3334
_exception_message(e)
@@ -51,7 +52,7 @@ def _exception_handler(func, raise_exceptions, error_return):
5152
def newfunc(*args, **kwds):
5253
try:
5354
return func(*args, **kwds)
54-
except exceptions.RopeError, e:
55+
except exceptions.RopeError as e:
5556
short = None
5657
if isinstance(e, input_exceptions):
5758
if not raise_exceptions:

0 commit comments

Comments
 (0)
0