Skip to content

Parsing error #4

@ghost

Description

OS: Windows 10 21H2
Python: Python 3.10.4

Steps:

  • pip install pyquotes

example.py

'''
Example File
'''

A = "This is a test string."
B = 'This is a test string.'
C = "This isn't a test string, or is it?"
D = f"{A}{B}{C}"
E = f'{A}{B}{C}'
  • pyquotes example.py
  • pyquotes --check example.py
  • pyquotes -D example.py
  • pyquotes -D --check example.py

All fail with the error

  File "C:\Python310\lib\site-packages\parso\python\tree.py", line 86, in get_doc_node
    c = simple_stmt.parent.children
AttributeError: 'NoneType' object has no attribute 'children'

If a print('Hello, World!') is added to the file, it behaves as expected.

Thank you for your time, this library has saved my many hours.

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