diff options
author | Emilio Pozuelo Monfort <pochu@debian.org> | 2020-08-13 11:47:12 +0200 |
---|---|---|
committer | Emilio Pozuelo Monfort <pochu@debian.org> | 2020-08-13 11:49:08 +0200 |
commit | f815d2033d464c3838f07188b8aa0ce773b6e57b (patch) | |
tree | e11f5594ad35aa4b6d13c0624a667ee3d6ccd88e /bin/report-vuln | |
parent | 71313afc95839aafa97534d37995156f19eb2ce4 (diff) |
De-duplicate setup_path
All the scripts in bin/ can share the definition. Also
setup_paths.py calls setup_path so one just has to import
that module before importing those from lib/python/.
Additionally this helps some scripts work better under Python 3,
as one variant of setup_paths that we had called string.rfind,
which is not present there.
Diffstat (limited to 'bin/report-vuln')
-rwxr-xr-x | bin/report-vuln | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/bin/report-vuln b/bin/report-vuln index ffa3ecc12f..d0dead6895 100755 --- a/bin/report-vuln +++ b/bin/report-vuln @@ -20,13 +20,8 @@ from textwrap import wrap temp_id = re.compile('(?:CVE|cve)\-[0-9]{4}-XXXX') -def setup_path(): - dirname = os.path.dirname - base = dirname(dirname(os.path.realpath(sys.argv[0]))) - sys.path.insert(0, os.path.join(base, "lib", "python")) - def description_from_list(id, pkg='', skip_entries=0): - setup_path() + import setup_paths import bugs import debian_support is_temp = temp_id.match(id) |