Mercurial > p > roundup > code
comparison roundup/admin.py @ 7799:10da9e12c10f
fix: replace FileNotFoundError with IOError
Python2 doesn't have the FileNotFoundError which is a subclass of
IOError.
So use IOError.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 10 Mar 2024 23:12:54 -0400 |
| parents | f84f7879c768 |
| children | 2d4684e4702d |
comparison
equal
deleted
inserted
replaced
| 7798:f84f7879c768 | 7799:10da9e12c10f |
|---|---|
| 2270 | 2270 |
| 2271 try: | 2271 try: |
| 2272 import readline | 2272 import readline |
| 2273 try: | 2273 try: |
| 2274 readline.read_init_file(initfile) | 2274 readline.read_init_file(initfile) |
| 2275 except FileNotFoundError: | 2275 except IOError: # FileNotFoundError under python3 |
| 2276 # file is optional | 2276 # file is optional |
| 2277 pass | 2277 pass |
| 2278 | 2278 |
| 2279 try: | 2279 try: |
| 2280 readline.read_history_file(histfile) | 2280 readline.read_history_file(histfile) |
| 2281 except FileNotFoundError: | 2281 except IOError: # FileNotFoundError under python3 |
| 2282 # no history file yet | 2282 # no history file yet |
| 2283 pass | 2283 pass |
| 2284 | 2284 |
| 2285 # Default history length is unlimited. | 2285 # Default history length is unlimited. |
| 2286 # Set persistently in readline init file | 2286 # Set persistently in readline init file |
