Skip to content

Commit 17f44e9

Browse files
committed
Catch exception from greenery during regeex matching and do more conservstive matching instead
1 parent bd6b0d0 commit 17f44e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jsonsubschema/_utils.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ def regex_isSubset(s1, s2):
189189
s1.cardinality()
190190
s2.cardinality()
191191
return set(s1.strings()).issubset(s2.strings())
192-
except OverflowError:
192+
except (OverflowError, Exception):
193+
# catching a general exception thrown from greenery
194+
# see https://github.com/qntm/greenery/blob/master/greenery/lego.py
195+
# ... raise Exception("Please choose an 'otherchar'")
193196
return s1.equivalent(s2) or (s1 & s2.everythingbut()).empty()
194197
elif s1:
195198
return True

0 commit comments

Comments
 (0)