use check parameter of subprocess.run

...instead of checking on our own.

Also increase required version of Python to 3.5 because of
subprocess.run().
This commit is contained in:
Sarah Hoffmann
2021-01-15 10:38:28 +01:00
parent de724aa576
commit 7cf9d459d6
3 changed files with 4 additions and 6 deletions

View File

@@ -21,9 +21,7 @@ def run_legacy_script(script, *args, nominatim_env=None, throw_on_fail=False):
if not env['NOMINATIM_OSM2PGSQL_BINARY']:
env['NOMINATIM_OSM2PGSQL_BINARY'] = nominatim_env.osm2pgsql_path
proc = subprocess.run(cmd, cwd=str(nominatim_env.project_dir), env=env)
if throw_on_fail:
proc.check_returncode()
proc = subprocess.run(cmd, cwd=str(nominatim_env.project_dir), env=env,
check=throw_on_fail)
return proc.returncode