Found this when looking for Python 2 code to purge 🤓 The relevant example can be found here: https://docs.twisted.org/en/stable/mail/examples/index.html#imap-clients
The code does probably work on Python 3, but I propose the following cleanup:
The following code can be dropped and all references to raw_input can be changed to the built-in input
try:
raw_input
except NameError:
# Python 3
raw_input = input
For completeness, we should also change the shebang #!/usr/bin/env python ---> #!/usr/bin/env python3 or remove it.
Found this when looking for Python 2 code to purge 🤓 The relevant example can be found here: https://docs.twisted.org/en/stable/mail/examples/index.html#imap-clients
The code does probably work on Python 3, but I propose the following cleanup:
The following code can be dropped and all references to
raw_inputcan be changed to the built-ininputFor completeness, we should also change the shebang
#!/usr/bin/env python--->#!/usr/bin/env python3or remove it.