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

Method __call__

api/python/examples/pe_reader.py:23–37  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

printFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected