Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 851182f

Browse filesBrowse files
committed
Removed useless lines and added replacing lines into init file
1 parent 545fe24 commit 851182f
Copy full SHA for 851182f

File tree

2 files changed

+4
-14
lines changed
Filter options

2 files changed

+4
-14
lines changed

‎scripts/__init__.py

Copy file name to clipboardExpand all lines: scripts/__init__.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from .cv2 import *
2-
from .data import *
1+
PYTHON_EXTENSIONS_PATHS = [
2+
LOADER_DIR
3+
] + PYTHON_EXTENSIONS_PATHS
34

45
ci_and_not_headless = False
56

‎setup.py

Copy file name to clipboardExpand all lines: setup.py
+1-12Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -376,22 +376,11 @@ def _classify_installed_files_override(
376376

377377
print("Copying files from CMake output")
378378

379-
# need for the proper import of a package
380-
with open('%spython/cv2/__init__.py'
381-
% cmake_install_dir, 'r') as opencv_init:
382-
opencv_init_data = ""
383-
for line in opencv_init:
384-
opencv_init_replacement = line.replace('importlib.import_module("cv2")', 'importlib.import_module("cv2.cv2")')
385-
opencv_init_data = opencv_init_data + opencv_init_replacement
386-
with open('%spython/cv2/__init__.py'
387-
% cmake_install_dir, 'w') as opencv_python_init:
388-
opencv_python_init.write(opencv_init_data)
389-
390379
# add lines from the old __init__.py file to the config file
391380
with open('scripts/__init__.py', 'r') as custom_init:
392381
custom_init_data = custom_init.read()
393382
with open('%spython/cv2/config-%s.%s.py'
394-
% (cmake_install_dir, sys.version_info[0], sys.version_info[1]), 'a') as opencv_init_config:
383+
% (cmake_install_dir, sys.version_info[0], sys.version_info[1]), 'w') as opencv_init_config:
395384
opencv_init_config.write(custom_init_data)
396385

397386
for package_name, relpaths_re in cls.package_paths_re.items():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.