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

Method __call__

api/python/examples/macho_reader.py:32–49  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

printFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected