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

Python 3 compatibility #25

wants to merge 2 commits into from

Conversation

monolithed
Copy link
Contributor

exec -> exec function

➜ sudo pip install tarantool

Downloading/unpacking tarantool
  Downloading tarantool-0.3.4.tar.gz
  Running setup.py egg_info for package tarantool
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/private/tmp/pip_build_root/tarantool/setup.py", line 9
        exec line
                ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/private/tmp/pip_build_root/tarantool/setup.py", line 9

    exec line

            ^

SyntaxError: invalid syntax

http://docs.python.org/3/library/functions.html#exec

xrange -> range

    import tarantool
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/tarantool/__init__.py", line 6, in <module>
    from tarantool.connection import Connection
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/tarantool/connection.py", line 12, in <module>
    from tarantool.request import (
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/tarantool/request.py", line 12, in <module>
    class Request(object):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/tarantool/request.py", line 25, in Request
    for val in xrange(0x4000)
NameError: name 'xrange' is not defined

http://docs.python.org/3/library/functions.html#range

StandardError -> Exception

    import tarantool
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/tarantool/__init__.py", line 6, in <module>
    from tarantool.connection import Connection
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/tarantool/connection.py", line 11, in <module>
    from tarantool.response import Response
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/tarantool/response.py", line 8, in <module>
    from tarantool.error import *
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/tarantool/error.py", line 28, in <module>
    class Error(StandardError):
NameError: name 'StandardError' is not defined

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

http://docs.python.org/3/library/exceptions.html#exceptions.Exception

➜ python --version
Python 3.3.0
➜ pip --version
pip 1.4.1 from /opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages (python 3.3)

@bigbes bigbes self-assigned this Feb 11, 2014
@bigbes
Copy link
Contributor

bigbes commented Feb 11, 2014

Thank you for your pull request, but it's not sufficient for py3k support. I'm working on it now.

@bigbes
Copy link
Contributor

bigbes commented Feb 12, 2014

Compatible version is available in py3k branch.

@bigbes bigbes closed this Feb 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants