Skip to content

Python3 compatiblity fixes#5

Open
elonen wants to merge 1 commit intonylas:masterfrom
elonen:master
Open

Python3 compatiblity fixes#5
elonen wants to merge 1 commit intonylas:masterfrom
elonen:master

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.

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.

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