From 7cf9d459d6ccb91d7efdce13d5b33d331e47c127 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 15 Jan 2021 10:38:28 +0100 Subject: [PATCH] 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(). --- CMakeLists.txt | 2 +- docs/admin/Installation.md | 2 +- nominatim/admin/exec_utils.py | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52c8331d..88565238 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ endif() #----------------------------------------------------------------------------- if (BUILD_IMPORTER) - find_package(PythonInterp 3) + find_package(PythonInterp 3.5 REQUIRED) find_program(PYOSMIUM pyosmium-get-changes) if (NOT EXISTS "${PYOSMIUM}") diff --git a/docs/admin/Installation.md b/docs/admin/Installation.md index c9d000b2..d8c98ef5 100644 --- a/docs/admin/Installation.md +++ b/docs/admin/Installation.md @@ -38,7 +38,7 @@ For running Nominatim: * [PostgreSQL](https://www.postgresql.org) (9.3+) * [PostGIS](https://postgis.net) (2.2+) - * [Python 3](https://www.python.org/) (3.4+) + * [Python 3](https://www.python.org/) (3.5+) * [Psycopg2](https://www.psycopg.org) * [PHP](https://php.net) (7.0 or later) * PHP-pgsql diff --git a/nominatim/admin/exec_utils.py b/nominatim/admin/exec_utils.py index f3f59dea..01582279 100644 --- a/nominatim/admin/exec_utils.py +++ b/nominatim/admin/exec_utils.py @@ -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 -- 2.45.1