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

Method __call__

api/python/examples/elf_reader.py:33–47  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

31 self.on_except_callback = on_except_callback
32
33 def __call__(self, *args, **kwargs):
34 if self.func is None:
35 self.func = args[0]
36 return self
37 try:
38 return self.func(*args, **kwargs)
39 except self.exceptions as e:
40 if self.on_except_callback is not None:
41 self.on_except_callback(e)
42 else:
43 print("-" * 60)
44 print("Exception in {}: {}".format(self.func.__name__, e))
45 exc_type, exc_value, exc_traceback = sys.exc_info()
46 traceback.print_tb(exc_traceback)
47 print("-" * 60)
48
49
50@exceptions_handler(Exception)

Callers

nothing calls this directly

Calls 2

printFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected