File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ def is_compound_expression(value: str) -> bool:
67
67
.. _SPDX license expression spec: https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/
68
68
.. _license-expression library: https://github.com/nexB/license-expression
69
69
"""
70
- return 0 == len (
71
- __SPDX_EXPRESSION_LICENSING .validate (value ).errors
72
- )
70
+ try :
71
+ res = __SPDX_EXPRESSION_LICENSING .validate (value )
72
+ except Exception :
73
+ # the throw happens when internals crash due to unexpected input characters.
74
+ return False
75
+ return 0 == len (res .errors )
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ def test_positive(self, valid_expression: str) -> None:
89
89
'MIT AND Apache-2.0 OR something-unknown'
90
90
'something invalid' ,
91
91
'(c) John Doe' ,
92
+ 'Apache License, Version 2.0'
92
93
)
93
94
def test_negative (self , invalid_expression : str ) -> None :
94
95
actual = spdx .is_compound_expression (invalid_expression )
You can’t perform that action at this time.
0 commit comments