summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2016-05-01 14:26:20 +0200
committerHelmut Grohne <helmut@subdivi.de>2016-05-01 14:26:20 +0200
commit2aef917cabba4e660f2525a551368532dbc7c195 (patch)
treec2e0b7f4a97be173c6f1a36446c452f59e60ee5d
parent8e326cadab47896f77666b0a4c7f434cdefc83da (diff)
downloaddebian-dedup-2aef917cabba4e660f2525a551368532dbc7c195.tar.gz
use same Python version for autoimport and importpkg
The autoimport tool runs the Python interpreter explicitly. Instead of invoking just "python" and thus calling whatever the current default is, use sys.executable which is the interpreter used to run autoimport, thus locking both to the same Python version.
-rwxr-xr-xautoimport.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/autoimport.py b/autoimport.py
index 5f14b2e..0d26fe4 100755
--- a/autoimport.py
+++ b/autoimport.py
@@ -11,6 +11,7 @@ import optparse
import os
import sqlite3
import subprocess
+import sys
import tempfile
try:
from urllib.parse import unquote
@@ -64,7 +65,7 @@ def process_dir(pkgs, d):
def process_pkg(name, pkgdict, outpath):
filename = pkgdict["filename"]
print("importing %s" % filename)
- importcmd = ["python", "importpkg.py"]
+ importcmd = [sys.executable, "importpkg.py"]
if "sha256hash" in pkgdict:
importcmd.extend(["-H", pkgdict["sha256hash"]])
if filename.startswith(("http://", "https://", "ftp://", "file://")):