-
Notifications
You must be signed in to change notification settings - Fork 45
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
Python3 compatiblity fixes #5
base: master
Are you sure you want to change the base?
Conversation
Note: this simply makes make-deb run on Python3, not package Py3 project properly. |
This commit breaks Python 2 compatibility. Python 2 defines the input() function to eval what the user inputs; whereas raw_input just returns the string. |
Looks like a lot of these changes have been done already. This can be closed I think. |
@@ -11,10 +11,10 @@ def main(): | |||
debconf = DebianConfiguration(os.getcwd()) | |||
debconf.render() | |||
except DebianConfigurationException as e: | |||
print e | |||
print(e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add from __future__ import print_function
as the first line, otherwise this can have surprising behavior when modified.
setup_names = ["name", "version", "maintainer", "maintainer_email", | ||
"description"] | ||
|
||
context = {} | ||
for name, value in zip(setup_names, setup_values): | ||
while not value or value == UNKNOWN: | ||
value = raw_input( | ||
value = input( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't safe for python2, input
on python2 is eval(raw_input())
Here are the changes I needed to make to run this in a Python3 venv. Feel free to reject if you want to stay Python 2.