From 2aef917cabba4e660f2525a551368532dbc7c195 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 1 May 2016 14:26:20 +0200 Subject: 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. --- autoimport.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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://")): -- cgit v1.2.3