diff options
| author | Mark Sapiro | 2016-12-04 15:40:12 -0800 |
|---|---|---|
| committer | Mark Sapiro | 2016-12-04 15:40:12 -0800 |
| commit | b7eef6badf3fc6e6bd0534ca58647f0e8219e977 (patch) | |
| tree | 7e2999232b8e3c6b54fffc5a31a90414c167ffe1 /src/mailman/utilities/interact.py | |
| parent | 0846595ab8f75afda49fcdf35abe87b609af55d5 (diff) | |
| parent | b50fc4b57c9a8886407fd9ae0b88bdaa2075d3a2 (diff) | |
| download | mailman-b7eef6badf3fc6e6bd0534ca58647f0e8219e977.tar.gz mailman-b7eef6badf3fc6e6bd0534ca58647f0e8219e977.tar.zst mailman-b7eef6badf3fc6e6bd0534ca58647f0e8219e977.zip | |
Diffstat (limited to 'src/mailman/utilities/interact.py')
| -rw-r--r-- | src/mailman/utilities/interact.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mailman/utilities/interact.py b/src/mailman/utilities/interact.py index fec980b80..48f3ae358 100644 --- a/src/mailman/utilities/interact.py +++ b/src/mailman/utilities/interact.py @@ -22,7 +22,8 @@ import sys import code from contextlib import suppress -from mailman import public +from inspect import signature +from public import public DEFAULT_BANNER = object() @@ -67,4 +68,10 @@ def interact(upframe=True, banner=DEFAULT_BANNER, overrides=None): Python %s on %s Type "help", "copyright", "credits" or "license" for more information.''' % ( sys.version, sys.platform) - interp.interact(banner) + # Python 3.6 added an exitmsg keyword but we don't currently support + # configuring it. For consistency between Python 3.6 and earlier + # versions, suppress the exit message if possible. + kws = dict(banner=banner) + if 'exitmsg' in signature(interp.interact).parameters: + kws['exitmsg'] = '' + interp.interact(**kws) |
