]> git.openstreetmap.org Git - nominatim.git/commitdiff
use check parameter of subprocess.run
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 15 Jan 2021 09:38:28 +0000 (10:38 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 15 Jan 2021 09:43:04 +0000 (10:43 +0100)
...instead of checking on our own.

Also increase required version of Python to 3.5 because of
subprocess.run().

CMakeLists.txt
docs/admin/Installation.md
nominatim/admin/exec_utils.py

index 52c8331d15a92706fddecf4a52dd0e50db0eab1a..88565238a131d4129c0dfdabf2b7829f3d20e1d4 100644 (file)
@@ -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}")
index c9d000b22ae8b85c05f22c5cb9a7c3f8507f5249..d8c98ef5056dfecb1a6b2b4761214eee8e8f22a9 100644 (file)
@@ -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
index f3f59dea9cbd26c73670da1f1ae1586540ee8f32..0158227957f04bc6afa76f820e276672213a1e7f 100644 (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