Skip to content

Example imap4client.py has Python 2 code (raw_input, and Python 2 shebang) #12252

@gudnimg

Description

@gudnimg

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions