diff options
| author | Barry Warsaw | 2016-04-30 13:34:04 -0400 |
|---|---|---|
| committer | GitLab | 2016-04-30 19:54:54 +0000 |
| commit | c6eb7ee3e574b48ee016dd31af2014b0ed083268 (patch) | |
| tree | 14c1f1e7bb382898ee50909333365aab335aa4a1 /src/mailman/utilities/interact.py | |
| parent | 465f24ff33e154385322ee894d32d8b7dd9b3941 (diff) | |
| download | mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.gz mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.tar.zst mailman-c6eb7ee3e574b48ee016dd31af2014b0ed083268.zip | |
Diffstat (limited to 'src/mailman/utilities/interact.py')
| -rw-r--r-- | src/mailman/utilities/interact.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mailman/utilities/interact.py b/src/mailman/utilities/interact.py index 3cc5dddc6..904d1b579 100644 --- a/src/mailman/utilities/interact.py +++ b/src/mailman/utilities/interact.py @@ -21,6 +21,7 @@ import os import sys import code +from contextlib import suppress from mailman import public @@ -51,10 +52,8 @@ def interact(upframe=True, banner=DEFAULT_BANNER, overrides=None): namespace.update(overrides) interp = code.InteractiveConsole(namespace) # Try to import the readline module, but don't worry if it's unavailable. - try: + with suppress(ImportError): import readline # noqa - except ImportError: # pragma: no cover - pass # Mimic the real interactive interpreter's loading of any $PYTHONSTARTUP # file. Note that if the startup file is not prepared to be exec'd more # than once, this could cause a problem. |
