This avoids a deprecation warning during import.
Fixes #157.
print('Connected.')
banner = '\nIMAPClient instance is "c"'
+ def ipython_400(c):
+ from IPython.terminal.embed import InteractiveShellEmbed
+ ipshell = InteractiveShellEmbed(banner1=banner)
+ ipshell('')
+
def ipython_011(c):
from IPython.frontend.terminal.embed import InteractiveShellEmbed
ipshell = InteractiveShellEmbed(banner1=banner)
import code
code.interact(banner, local=dict(c=c))
- for shell_attempt in (ipython_011, ipython_010, builtin):
+ shell_attempts = (
+ ipython_400,
+ ipython_011,
+ ipython_010,
+ builtin,
+ )
+ for shell in shell_attempts:
try:
- shell_attempt(client)
- break
+ shell(client)
except ImportError:
pass
+ else:
+ break
if __name__ == '__main__':
main()