Content-Length: 309720 | pFad | http://github.com/opencv/opencv-python/commit/851182fbb01f1655fe5ca4da9ca24b917765758a

3F Removed useless lines and added replacing lines into init file · opencv/opencv-python@851182f · GitHub
Skip to content

Commit 851182f

Browse files
committed
Removed useless lines and added replacing lines into init file
1 parent 545fe24 commit 851182f

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

scripts/__init__.py

+3-2
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

+1-12
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/opencv/opencv-python/commit/851182fbb01f1655fe5ca4da9ca24b917765758a

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy