]> git.openstreetmap.org Git - nominatim.git/commitdiff
avoid issues with Python < 3.9 and linting
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 3 Jul 2022 09:33:19 +0000 (11:33 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 18 Jul 2022 07:47:57 +0000 (09:47 +0200)
.pylintrc
nominatim/db/utils.py

index 52d9fcf9e623b2b709841efe35d1a9995cb5a9fe..e860940778fe9492072a9d50ce322ea643df6ce9 100644 (file)
--- a/.pylintrc
+++ b/.pylintrc
@@ -11,6 +11,8 @@ ignored-modules=icu,datrie
 # 'with' statements.
 ignored-classes=NominatimArgs,closing
 # 'too-many-ancestors' is triggered already by deriving from UserDict
-disable=too-few-public-methods,duplicate-code,too-many-ancestors,bad-option-value,no-self-use
+# 'not-context-manager' disabled because it causes false positives once
+#   typed Python is enabled. See also https://github.com/PyCQA/pylint/issues/5273
+disable=too-few-public-methods,duplicate-code,too-many-ancestors,bad-option-value,no-self-use,not-context-manager
 
 good-names=i,x,y,fd,db,cc
index e2b63e1dd0e360e528724e5019608a7153e31b5f..461cb662415910844b87042aa76df2754046e13f 100644 (file)
@@ -19,7 +19,7 @@ from nominatim.errors import UsageError
 
 LOG = logging.getLogger()
 
-def _pipe_to_proc(proc: subprocess.Popen[bytes],
+def _pipe_to_proc(proc: 'subprocess.Popen[bytes]',
                   fdesc: Union[IO[bytes], gzip.GzipFile]) -> int:
     assert proc.stdin is not None
     chunk = fdesc.read(2048)