Menu

#19 conditional import of DebianInstaller

closed
nobody
None
5
2017-05-16
2016-04-07
bidon
No

Line 26 of setup.py there is an import that make the script fail on non debian platform (ie. macports):

from contrib.debian.installer import DebianInstaller

Could this import be only done on debian?

Could this code do the trick?

if getattr(install, "install_layout", None) && install.install_layout == "deb":
    from contrib.debian.installer import DebianInstaller

Discussion

  • bidon

    bidon - 2016-04-07

    Oops, I made some errors in the proposed code. Here is a better version.

    if (getattr(install, "install_layout", None) and install.install_layout == "deb"):
        from contrib.debian.installer import DebianInstaller
    
     
  • Guillon

    Guillon - 2017-04-04

    What is the behaviour when setup.py is called? I don't see what error can appear when the module or class is loaded.

     
  • bidon

    bidon - 2017-04-06

    Sorry, I tested a new install of version 0.3.9 and 0.3.10 and the problem has gone. Can't find what was wrong. Please, forget my request.

     
  • Guillon

    Guillon - 2017-05-16
    • status: open --> closed
     

Log in to post a comment.