X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a0ed80d821bd3f7938a2e3d4e38357f0c03b919e..37b2c6a830c90aea17b76c5b6a74c711025a142d:/nominatim/tokenizer/legacy_tokenizer.py diff --git a/nominatim/tokenizer/legacy_tokenizer.py b/nominatim/tokenizer/legacy_tokenizer.py index 3b8f7569..36fd5722 100644 --- a/nominatim/tokenizer/legacy_tokenizer.py +++ b/nominatim/tokenizer/legacy_tokenizer.py @@ -74,10 +74,10 @@ def _check_module(module_dir, conn): with conn.cursor() as cur: try: cur.execute("""CREATE FUNCTION nominatim_test_import_func(text) - RETURNS text AS '{}/nominatim.so', 'transliteration' + RETURNS text AS %s, 'transliteration' LANGUAGE c IMMUTABLE STRICT; DROP FUNCTION nominatim_test_import_func(text) - """.format(module_dir)) + """, (f'{module_dir}/nominatim.so', )) except psycopg2.DatabaseError as err: LOG.fatal("Error accessing database module: %s", err) raise UsageError("Database module cannot be accessed.") from err @@ -250,12 +250,12 @@ class LegacyTokenizer(AbstractTokenizer): php_file = self.data_dir / "tokenizer.php" if not php_file.exists() or overwrite: - php_file.write_text(dedent("""\ + php_file.write_text(dedent(f"""\