Skip to content

module 'editor' has no attribute 'edit' with python3 #28

Description

@leggewie

import editor
commit_msg = editor.edit(contents=b"# Enter commit message here")

This works in the python3 command line (while exhibiting bug #1), but when called as a script I get the following error.

$ python3 /home/leggewie/.PyCharmCE2019.2/config/scratches/editor.py

Traceback (most recent call last):
File "/home/leggewie/.PyCharmCE2019.2/config/scratches/editor.py", line 1, in
import editor
File "/home/leggewie/.PyCharmCE2019.2/config/scratches/editor.py", line 3, in
commit_msg = editor.edit(contents=b"# Enter commit message here")
AttributeError: module 'editor' has no attribute 'edit'

python3 -c 'import editor; editor.edit(contents=b"# Enter commit message here")' works fine and does not bring about #1, either.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions