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

Method __call__

api/python/examples/oat_reader.py:31–48  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

printFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected