MCPcopy Create free account
hub / github.com/lief-project/LIEF / __call__

Method __call__

api/python/examples/abstract_reader.py:21–35  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

19 self.on_except_callback = on_except_callback
20
21 def __call__(self, *args, **kwargs):
22 if self.func is None:
23 self.func = args[0]
24 return self
25 try:
26 return self.func(*args, **kwargs)
27 except self.exceptions as e:
28 if self.on_except_callback is not None:
29 self.on_except_callback(e)
30 else:
31 print("-" * 60)
32 print("Exception in {}: {}".format(self.func.__name__, e))
33 exc_type, exc_value, exc_traceback = sys.exc_info()
34 traceback.print_tb(exc_traceback)
35 print("-" * 60)
36
37
38

Callers

nothing calls this directly

Calls 2

printFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected