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

Fixed python3 incopabilities. #212

Merged
merged 1 commit into from May 7, 2012

Conversation

Projects
None yet
4 participants
@Slezhuk

Slezhuk commented Apr 25, 2012

modified: lib/fpm/package/python.rb

Added python3 support. Useful for packaging python3 projects. For example:
fpm -s python -t deb --python-bin /usr/bin/python3 myproject/setup.py

Slezhuk Evgeniy
modified: lib/fpm/package/pyfpm/get_metadata.py
	modified:   lib/fpm/package/python.rb

Added python3 support. Useful for packaging python3 projects. For example:
fpm -s python -t deb --python-bin /usr/bin/python3 myproject/setup.py
@jordansissel

This comment has been minimized.

Owner

jordansissel commented Apr 25, 2012

Tested this works in python 2.7.2, will test some older pythongs too just to be sure.

print json.dumps(data, indent=2)
except AttributeError, e:
print(json.dumps(data, indent=2))
except AttributeError as e:

This comment has been minimized.

@jordansissel

jordansissel Apr 25, 2012

Owner

This line works in python 2.7, but not python 2.4. Centos5 users still have to use python 2.4 in almost all cases.

Is there no common syntax between python 3 and 2.4 here?

Maybe it's worth having two separate setuptools command modules, one for python < 3 and one for python > 3? Maybe 'pyfpm2' and 'pyfpm3' ?

This comment has been minimized.

@jordansissel

jordansissel Apr 25, 2012

Owner

ahh yeah, some other syntax doesn't work either, like the 'value if condition else value2' stuff that's already in here. hmm

@lclarkmichalek

This comment has been minimized.

lclarkmichalek commented Apr 26, 2012

I'd suggest using sys.stdout.write instead of print.

@specialunderwear

This comment has been minimized.

Contributor

specialunderwear commented Apr 27, 2012

from future import print_function

@specialunderwear

This comment has been minimized.

Contributor

specialunderwear commented Apr 27, 2012

and::

except AttributeError:
# e is not even used so leave it

@lclarkmichalek

This comment has been minimized.

lclarkmichalek commented Apr 27, 2012

Python hasn't always supported from future import print_statement, but sys.stdout is timeless

@specialunderwear

This comment has been minimized.

Contributor

specialunderwear commented Apr 27, 2012

You are right

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Apr 29, 2012

Merging this as is; if someone wants older python support, we can address that when someone asks :)

Thanks for this! :)h

@Slezhuk

This comment has been minimized.

Slezhuk commented May 2, 2012

Thanks :)

jordansissel added a commit that referenced this pull request May 7, 2012

Merge pull request #212 from Slezhuk/master
Fixed python3 incopabilities.

@jordansissel jordansissel merged commit 82e6b01 into jordansissel:master May 7, 2012

prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 18, 2014

prof-milki pushed a commit to prof-milki/xpm that referenced this pull request Dec 27, 2014

jordansissel added a commit that referenced this pull request Apr 24, 2015

Merge pull request #212 from Slezhuk/master
Fixed python3 incopabilities.

jordansissel added a commit that referenced this pull request Jun 20, 2016

Merge pull request #212 from Slezhuk/master
Fixed python3 incopabilities.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment