Skip to content

Commit cd3e4a5

Browse files
authored
Fix some but not all undefined names in scripts/__init__.py
Related to changes made in #563 $ `flake8 . --count --builtins=ml_ops --select=E9,F63,F7,F82,Y --show-source --statistics` ``` ./opencv-python/scripts/__init__.py:2:5: F821 undefined name 'LOADER_DIR' LOADER_DIR ^ ./opencv-python/scripts/__init__.py:3:5: F821 undefined name 'PYTHON_EXTENSIONS_PATHS' ] + PYTHON_EXTENSIONS_PATHS ^ ./opencv-python/scripts/__init__.py:15:4: F821 undefined name 'sys' if sys.platform.startswith("linux") and ci_and_not_headless: ^ ./opencv-python/scripts/__init__.py:16:5: F821 undefined name 'os' os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = os.path.join( ^ ./opencv-python/scripts/__init__.py:16:49: F821 undefined name 'os' os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = os.path.join( ^ ./opencv-python/scripts/__init__.py:17:9: F821 undefined name 'os' os.path.dirname(os.path.abspath(__file__)), "qt", "plugins" ^ ./opencv-python/scripts/__init__.py:17:25: F821 undefined name 'os' os.path.dirname(os.path.abspath(__file__)), "qt", "plugins" ^ ./opencv-python/scripts/__init__.py:21:4: F821 undefined name 'sys' if sys.platform.startswith("linux") and ci_and_not_headless: ^ ./opencv-python/scripts/__init__.py:22:5: F821 undefined name 'os' os.environ["QT_QPA_FONTDIR"] = os.path.join( ^ ./opencv-python/scripts/__init__.py:22:36: F821 undefined name 'os' os.environ["QT_QPA_FONTDIR"] = os.path.join( ^ ./opencv-python/scripts/__init__.py:23:9: F821 undefined name 'os' os.path.dirname(os.path.abspath(__file__)), "qt", "fonts" ^ ./opencv-python/scripts/__init__.py:23:25: F821 undefined name 'os' os.path.dirname(os.path.abspath(__file__)), "qt", "fonts" ^ 12 F821 undefined name 'LOADER_DIR' 12 ```
1 parent 053e8cc commit cd3e4a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import os
2+
import sys
3+
14
PYTHON_EXTENSIONS_PATHS = [
25
LOADER_DIR
36
] + PYTHON_EXTENSIONS_PATHS
@@ -8,7 +11,7 @@
811
from .version import ci_build, headless
912

1013
ci_and_not_headless = ci_build and not headless
11-
except:
14+
except ImportError:
1215
pass
1316

1417
# the Qt plugin is included currently only in the pre-built wheels

0 commit comments

Comments
 (0)