humanoid-path-planner / hpp-doc

Documentation for project Humanoid Path Planner
https://humanoid-path-planner.github.io/hpp-doc
ISC License
29 stars 23 forks source link

make packageDep compatible with python 2 & 3 #15

Closed nim65s closed 7 years ago

nim65s commented 7 years ago

/usr/bin/python may be python2 or python3 depending on the distribution, so we should ensure that this script would work on both.

florent-lamiraux commented 7 years ago

Thank you. However, it does not work with python2 anymore. It seems that "future" is not defined, unless another package is required.

nim65s commented 7 years ago

You are right, "pip install future" would be required in this case. The alternatives are :

  1. specifying that this script can only work with python2 with : #!/usr/bin/env python2
  2. or trying both :
    try:  # python2
    from commands import getstatusoutput
    except:  # python3
    from subprocess import getstatusoutput

Which one do you prefer ?

jmirabel commented 7 years ago

Has this been tested by someone ? I see no objection to merging it.

jmirabel commented 7 years ago

I rebased your work on devel and on version-3 branches. Thanks !