Skip to content

Commit ae03030

Browse files
authored
Merge pull request #535 from tlsfuzzer/more-errors-on-import-mlkem
fail kyber_py import because of SyntaxError too
2 parents 412a531 + 7ec0788 commit ae03030

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tlslite/utils/compat.py

+4
Original file line numberDiff line numberDiff line change
@@ -244,5 +244,9 @@ def byte_length(val):
244244
del ML_KEM_1024
245245
except ImportError:
246246
ML_KEM_AVAILABLE = False
247+
except SyntaxError:
248+
# trying to import it on older Python versions causes it to abort with
249+
# SyntaxError not ImportError
250+
ML_KEM_AVAILABLE = False
247251
else:
248252
ML_KEM_AVAILABLE = True

0 commit comments

Comments
 (0)