diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rwxr-xr-x | generator.py | 7 | ||||
-rw-r--r-- | libvirt-override.py | 5 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am index eda2866..432ad70 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,7 +53,7 @@ GENERATED= libvirt-export.c \ libvirt.py generated.stamp: $(srcdir)/$(GENERATE) $(API_DESC) - $(PYTHON) $(srcdir)/$(GENERATE) $(srcdir) + $(PYTHON) $(srcdir)/$(GENERATE) $(PYTHON) touch $@ $(GENERATED): generated.stamp diff --git a/generator.py b/generator.py index 6f4bb40..4fa4f65 100755 --- a/generator.py +++ b/generator.py @@ -14,6 +14,11 @@ import re if __name__ == "__main__": # launched as a script srcPref = os.path.dirname(sys.argv[0]) + if len(sys.argv) > 1: + python = sys.argv[1] + else: + print "Python binary not specified" + sys.exit(1) else: # imported srcPref = os.path.dirname(__file__) @@ -1012,7 +1017,7 @@ def buildWrappers(): classes = open("libvirt.py", "w") extra = open(os.path.join(srcPref,"libvirt-override.py"), "r") - classes.write("#!/usr/bin/env python\n") + classes.write("#! " + python + " -i\n") classes.write("#\n") classes.write("# WARNING WARNING WARNING WARNING\n") classes.write("#\n") diff --git a/libvirt-override.py b/libvirt-override.py index 909ebe3..d544a0e 100644 --- a/libvirt-override.py +++ b/libvirt-override.py @@ -2,11 +2,6 @@ # Manually written part of python bindings for libvirt # -# Specify -i commandline option after python was started -if __name__ == "__main__": - import os - os.environ["PYTHONINSPECT"] = "1" - # On cygwin, the DLL is called cygvirtmod.dll try: import libvirtmod |