Remembers a string of source code, and returns a fake filename to use to retrieve it later.
(code_string: str)
| 70 | |
| 71 | |
| 72 | def filename_for_console_input(code_string: str) -> str: |
| 73 | """Remembers a string of source code, and returns |
| 74 | a fake filename to use to retrieve it later.""" |
| 75 | if isinstance(linecache.cache, BPythonLinecache): |
| 76 | return linecache.cache.remember_bpython_input(code_string) |
| 77 | else: |
| 78 | # If someone else has patched linecache.cache, better for code to |
| 79 | # simply be unavailable to inspect.getsource() than to raise |
| 80 | # an exception. |
| 81 | return "<input>" |
no test coverage detected