unpack: add can_unpack routine

This commit is contained in:
William Ballenthin
2020-08-29 21:38:26 -06:00
parent ec55a9c482
commit 216e288ade

View File

@@ -1,3 +1,4 @@
import sys
import logging
try:
@@ -13,6 +14,11 @@ class NotPackedError(ValueError):
super(NotPackedError, self).__init__("not packed")
def can_unpack():
# the unpacking backend is based on Speakeasy, which supports python 3.6+
return sys.version_info >= (3, 6)
@lru_cache
def get_unpackers():
# break import loop