Skip to content
Snippets Groups Projects
Verified Commit f869d433 authored by Ivan Sinkarenko's avatar Ivan Sinkarenko :snake:
Browse files

Update customizersUsed to get the robust imports, add extra protection from duplicated supertypes

parent c98e6b15
No related branches found
No related tags found
1 merge request!19Improve robustness of java.lang.Throwable supertypes
......@@ -1111,10 +1111,11 @@ def jpypeCustomizerSuperTypes(jClass: jpype.JClass, classTypeVars: List[TypeVarS
typeStr += '[' + ', '.join([tv.pythonName for tv in classTypeVars]) + ']'
extraSuperTypes.append(typeStr)
customizersUsed.add(customizer)
if jClass.class_.getName() == 'java.lang.Throwable':
if jClass.class_.getName() == 'java.lang.Throwable' and 'jpype.JException' not in extraSuperTypes:
# Workaround to allow Throwable-derived exception types be recognized
# as JException, so that they can be assigned as Exception.__cause__
extraSuperTypes.append('jpype.JException')
customizersUsed.add(jpype.JException)
return extraSuperTypes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment