Skip to content

Commit

Permalink
fickling-audit.py: print exception to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Nov 8, 2024
1 parent 4108a67 commit d872f03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assets/fickling-audit.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import fickling
from os import environ, path
import sys

def is_pickle_unsafe(file_path):
try:
return not fickling.is_likely_safe(file_path)
except Exception:
except (NotImplementedError):
return False
except Exception as e:
# print exception on stderr
print("%s: (%s) %s" % (e.__class__.__qualname__, file_path, e), file=sys.stderr)
return False

def main():
Expand Down

0 comments on commit d872f03

Please sign in to comment.