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

Method __call__

api/python/examples/dex_reader.py:29–46  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

printFunction · 0.50
formatMethod · 0.45

Tested by

no test coverage detected