Skip to content

Commit

Permalink
Fix some but not all undefined names in scripts/__init__.py
Browse files Browse the repository at this point in the history
Related to changes made in opencv#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
```
  • Loading branch information
cclauss committed Nov 25, 2021
1 parent 053e8cc commit cd3e4a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/__init__.py
@@ -1,3 +1,6 @@
import os
import sys

PYTHON_EXTENSIONS_PATHS = [
LOADER_DIR
] + PYTHON_EXTENSIONS_PATHS
Expand All @@ -8,7 +11,7 @@
from .version import ci_build, headless

ci_and_not_headless = ci_build and not headless
except:
except ImportError:
pass

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

0 comments on commit cd3e4a5

Please sign in to comment.