Skip to content

Python 3 compatibility #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Read package version without importing it
for line in open(os.path.join(os.path.dirname(__file__), "src", "tarantool", "__init__.py")):
if line.startswith("__version__"):
exec line
exec(line)
break

# Extra commands for documentation management
Expand Down
7 changes: 6 additions & 1 deletion src/tarantool/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
|__InternalError
|__ProgrammingError
|__NotSupportedError


In Python 2.7, all exceptions are children of StandardError,
and from Python 3 on they descend directly from Exception.

'''

import os
Expand All @@ -25,7 +30,7 @@
import warnings


class Error(StandardError):
class Error(Exception):
'''Base class for error exceptions'''


Expand Down
2 changes: 1 addition & 1 deletion src/tarantool/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Request(object):
_int_base128 = tuple(
(
struct_B.pack(val) if val < 128 else struct_BB.pack(val >> 7 & 0xff | 0x80, val & 0x7F) \
for val in xrange(0x4000)
for val in range(0x4000)
)
)

Expand Down