mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
commit
bc1af6227a
@ -358,7 +358,11 @@ _IplImage
|
|||||||
needed for correct deallocation */
|
needed for correct deallocation */
|
||||||
|
|
||||||
#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)
|
#if defined(CV__ENABLE_C_API_CTORS) && defined(__cplusplus)
|
||||||
_IplImage() {}
|
_IplImage()
|
||||||
|
{
|
||||||
|
memset(this, 0, sizeof(*this)); // valid for POD structure
|
||||||
|
nSize = sizeof(IplImage);
|
||||||
|
}
|
||||||
_IplImage(const cv::Mat& m) { *this = cvIplImage(m); }
|
_IplImage(const cv::Mat& m) { *this = cvIplImage(m); }
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,20 @@ def bootstrap():
|
|||||||
if DEBUG: print('OpenCV loader: PYTHON_EXTENSIONS_PATHS={}'.format(str(l_vars['PYTHON_EXTENSIONS_PATHS'])))
|
if DEBUG: print('OpenCV loader: PYTHON_EXTENSIONS_PATHS={}'.format(str(l_vars['PYTHON_EXTENSIONS_PATHS'])))
|
||||||
if DEBUG: print('OpenCV loader: BINARIES_PATHS={}'.format(str(l_vars['BINARIES_PATHS'])))
|
if DEBUG: print('OpenCV loader: BINARIES_PATHS={}'.format(str(l_vars['BINARIES_PATHS'])))
|
||||||
|
|
||||||
|
applySysPathWorkaround = False
|
||||||
|
if hasattr(sys, 'OpenCV_REPLACE_SYS_PATH_0'):
|
||||||
|
applySysPathWorkaround = True
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
BASE_DIR = os.path.dirname(LOADER_DIR)
|
||||||
|
if sys.path[0] == BASE_DIR or os.path.realpath(sys.path[0]) == BASE_DIR:
|
||||||
|
applySysPathWorkaround = True
|
||||||
|
except:
|
||||||
|
if DEBUG: print('OpenCV loader: exception during checking workaround for sys.path[0]')
|
||||||
|
pass # applySysPathWorkaround is False
|
||||||
|
|
||||||
for p in reversed(l_vars['PYTHON_EXTENSIONS_PATHS']):
|
for p in reversed(l_vars['PYTHON_EXTENSIONS_PATHS']):
|
||||||
sys.path.insert(1, p)
|
sys.path.insert(1 if not applySysPathWorkaround else 0, p)
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
if sys.version_info[:2] >= (3, 8): # https://github.com/python/cpython/pull/12302
|
if sys.version_info[:2] >= (3, 8): # https://github.com/python/cpython/pull/12302
|
||||||
|
Loading…
Reference in New Issue
Block a user