Skip to content

Commit bbff288

Browse files
committed
fix build with python3 only
1 parent b33853c commit bbff288

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

cmake/OpenCVDetectPython.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,13 @@ find_python(3.4 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
232232
PYTHON3_INCLUDE_DIR PYTHON3_INCLUDE_DIR2 PYTHON3_PACKAGES_PATH
233233
PYTHON3_NUMPY_INCLUDE_DIRS PYTHON3_NUMPY_VERSION)
234234

235-
# Use Python 2 as default Python interpreter
236-
if(PYTHON2INTERP_FOUND)
235+
236+
if(PYTHON_DEFAULT_EXECUTABLE)
237+
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
238+
elseif(PYTHON2INTERP_FOUND) # Use Python 2 as default Python interpreter
237239
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
238240
set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON2_EXECUTABLE}")
241+
elseif(PYTHON3INTERP_FOUND) # Use Python 2 as fallback Python interpreter (if there is no Python 2)
242+
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
243+
set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON3_EXECUTABLE}")
239244
endif()

modules/java/generator/gen_java.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,10 @@ def __init__(self, decl, namespaces=[]): # [ funcname, return_ctype, [modifiers]
924924
def __repr__(self):
925925
return Template("FUNC <$ctype $namespace.$classpath.$name $args>").substitute(**self.__dict__)
926926

927+
def __lt__(self, other):
928+
return self.__repr__() < other.__repr__()
929+
930+
927931
class JavaWrapperGenerator(object):
928932
def __init__(self):
929933
self.clear()

0 commit comments

Comments
 (0)