Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while parsing the given code #13

Closed
developedpage opened this issue Nov 22, 2024 · 0 comments · Fixed by #14
Closed

Error while parsing the given code #13

developedpage opened this issue Nov 22, 2024 · 0 comments · Fixed by #14
Labels
bug Something isn't working

Comments

@developedpage
Copy link
Contributor

Code:

class MatchLocale(Filter):
    def __init__(self) -> None:
        pass

    async def __call__(self, message: Message, config: AppConfig) -> bool:
        if not message.from_user:
            return False

        return message.text in [
            LazyProxy(cast(str, key)) for key in config.telegram.locales
        ]

Error:

  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ast.py", line 417, in generic_visit
    self.visit(value)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ast.py", line 407, in visit
    return visitor(node)
           ^^^^^^^^^^^^^
  File "/Users/developedpage/Library/Caches/pypoetry/virtualenvs/aiogramskeleton-7_Co3vY6-py3.12/lib/python3.12/site-packages/ftl_extract/matcher.py", line 154, in visit_Call
    key=cast(ast.Constant, node.args[0]).value,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Call' object has no attribute 'value'
andrew000 added a commit that referenced this issue Nov 22, 2024
@developedpage developedpage changed the title Error with the given code Error while parsing the given code Nov 22, 2024
@andrew000 andrew000 added the bug Something isn't working label Nov 22, 2024
@andrew000 andrew000 mentioned this issue Nov 22, 2024
developedpage added a commit to developedpage/FTL-Extract that referenced this issue Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants