diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-02-12 17:10:04 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-02-24 10:39:04 +0100 |
commit | af741607ead03c6616f93a21eeebcdd66ea4cd7a (patch) | |
tree | 99898b643d9b0c63ab6a3cfff01f416e4b779f39 | |
parent | 014cd7ab0edd770fc0cfb0aa8d69d2b2fdd5849c (diff) | |
download | urlgrabber-af741607ead03c6616f93a21eeebcdd66ea4cd7a.tar.gz |
Allow overriding the path to urlgrabber-ext-down with an env var
Otherwise, the tests try to call the installed executable, which
might be stale or not exist at all.
I now run the tests with:
URLGRABBER_EXT_DOWN=scripts/urlgrabber-ext-down PYTHONPATH=. python2 test/runtests.py
URLGRABBER_EXT_DOWN=scripts/urlgrabber-ext-down PYTHONPATH=. python3 test/runtests.py
-rw-r--r-- | urlgrabber/grabber.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py index f5bff55..5d337e5 100644 --- a/urlgrabber/grabber.py +++ b/urlgrabber/grabber.py @@ -2112,8 +2112,10 @@ import subprocess class _ExternalDownloader: def __init__(self): + urlgrabber_path = (os.getenv('URLGRABBER_EXT_DOWN', None) + or '/usr/libexec/urlgrabber-ext-down') self.popen = subprocess.Popen( - '/usr/libexec/urlgrabber-ext-down', + urlgrabber_path, stdin = subprocess.PIPE, stdout = subprocess.PIPE, ) |