Skip to content
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

Make it Compatible with Python3 #5

Closed
wants to merge 1 commit into from

Conversation

karelyatin
Copy link

Exception, print Syntax is not compatible with python3, this patch
fixes it. Following changes are done:

  • except Exception, e => except Exception as e
  • raise Error, "MSG" => raise Error("MSG")
  • print "MSG" => print("MSG")

@karelyatin karelyatin force-pushed the python3 branch 2 times, most recently from 1225253 to d068917 Compare May 12, 2017 15:41
Some code syntax is not compatible with python3, this patch
fixes makes it compatible for both python 2 and 3.
Following changes are done:

- except Exception, e  => except Exception as e
- raise Error, "MSG" => raise Error("MSG")
- print "MSG" => print("MSG")
- use builtins.int to coverup long in python 2
- use past.builtins.basestring to coverup basestring in python 3
- d.itervalues() => iter(d.values())
- d.iteritems() => iter(d.items())
- d.iterkeys() => iter(d.keys())
- using 'in' in place of 'has_key'
@karelyatin
Copy link
Author

stale PR for too long, closing

@karelyatin karelyatin closed this Sep 12, 2023
@karelyatin karelyatin deleted the python3 branch September 12, 2023 05:56
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.

None yet

1 participant