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

Python3 compatiblity fixes #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Python3 compatiblity fixes #5

wants to merge 1 commit into from

Conversation

elonen
Copy link

@elonen elonen commented Aug 18, 2015

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.

@elonen
Copy link
Author

elonen commented Aug 18, 2015

Note: this simply makes make-deb run on Python3, not package Py3 project properly.

@systemizer
Copy link
Contributor

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.

@msabramo
Copy link

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)
Copy link

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(
Copy link

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())

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.

4 participants