/usr/lib/python2.7/dist-packages/chemfp/error_handlers.py is in python-chemfp 1.1p1-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | "internal module; not for general use"
from __future__ import absolute_import
import sys
from . import ParseError
def ignore_parse_errors(msg):
pass
def report_parse_errors(msg):
sys.stderr.write("ERROR: %s. Skipping.\n" % (msg,))
def strict_parse_errors(msg):
raise ParseError(msg)
_parse_error_handlers = {
"ignore": ignore_parse_errors,
"report": report_parse_errors,
"strict": strict_parse_errors,
}
def get_parse_error_handler(errors):
try:
return _parse_error_handlers[errors]
except KeyError:
raise ValueError("'errors' must be one of %s" % ", ".join(sorted(_parse_error_handlers)))
|