Check if the PYTHON_HISTORY environment variable is set and define it as the .python_history file. If PYTHON_HISTORY is not set, use the default .python_history file.
()
| 470 | |
| 471 | |
| 472 | def gethistoryfile(): |
| 473 | """Check if the PYTHON_HISTORY environment variable is set and define |
| 474 | it as the .python_history file. If PYTHON_HISTORY is not set, use the |
| 475 | default .python_history file. |
| 476 | """ |
| 477 | if not sys.flags.ignore_environment: |
| 478 | history = os.environ.get("PYTHON_HISTORY") |
| 479 | if history: |
| 480 | return history |
| 481 | return os.path.join(os.path.expanduser('~'), |
| 482 | '.python_history') |
| 483 | |
| 484 | |
| 485 | def enablerlcompleter(): |
no test coverage detected
searching dependent graphs…