mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-01-09 14:08:03 -05:00
Starting with [1] there is still technically a print override
applied in pyghidra/script.py
printer = _build_script_print(self._script.writer)
super().__setitem__("print", printer)
but its interface is the same as the builtin print:
def _build_script_print(stdout):
@functools.wraps(print)
def wrapper(*objects, sep=' ', end='\n', file=None, flush=False):
...
return wrapper
and very much incompatible with the interface that the stubs used to
declare:
@typing.overload
def print(message: typing.Union[java.lang.String, str], color: java.awt.Color):
...
@typing.overload
def print(message: typing.Union[java.lang.String, str]):
...
This is similar to [2] and [3].
[1] 92d0f1dacf ("Python3 support")
[2] cc15fdf691 ("GP-0: ghidra_builtins stubs no longer hides the python set type (Closes #7222)")
[3] https://github.com/NationalSecurityAgency/ghidra/issues/7222