Mercurial > p > roundup > code
comparison roundup/admin.py @ 7798:f84f7879c768
fix: handle case where readline init file is missing
Ignore the FileNotFoundError. File is optional.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 10 Mar 2024 22:47:58 -0400 |
| parents | 8bdf0484215c |
| children | 10da9e12c10f |
comparison
equal
deleted
inserted
replaced
| 7797:8bdf0484215c | 7798:f84f7879c768 |
|---|---|
| 2268 histfile = os.path.join(os.path.expanduser("~"), | 2268 histfile = os.path.join(os.path.expanduser("~"), |
| 2269 ".roundup_admin_history") | 2269 ".roundup_admin_history") |
| 2270 | 2270 |
| 2271 try: | 2271 try: |
| 2272 import readline | 2272 import readline |
| 2273 readline.read_init_file(initfile) | 2273 try: |
| 2274 readline.read_init_file(initfile) | |
| 2275 except FileNotFoundError: | |
| 2276 # file is optional | |
| 2277 pass | |
| 2278 | |
| 2274 try: | 2279 try: |
| 2275 readline.read_history_file(histfile) | 2280 readline.read_history_file(histfile) |
| 2276 except FileNotFoundError: | 2281 except FileNotFoundError: |
| 2277 # no history file yet | 2282 # no history file yet |
| 2278 pass | 2283 pass |
