You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While investingating some non-transformed files, I came across this case:
A = "foo.{bar}"
def foo(x):
return A.format(x)
When running flynt on this in verbose mode, the following output appears:
Exception during conversion of code: Traceback (most recent call last):
File "~/venv/flynt/lib64/python3.11/site-packages/flynt/transform/transform.py", line 32, in transform_chunk
converted, changed = fstringify_node(
^^^^^^^^^^^^^^^^
File "~/venv/flynt/lib64/python3.11/site-packages/flynt/transform/FstringifyTransformer.py", line 88, in fstringify_node
result = ft.visit(node)
^^^^^^^^^^^^^^
File "/opt/blue-python/3.11/lib64/python3.11/ast.py", line 418, in visit
return visitor(node)
^^^^^^^^^^^^^
File "~/venv/flynt/lib64/python3.11/site-packages/flynt/transform/FstringifyTransformer.py", line 31, in visit_Call
result_node = joined_string(
^^^^^^^^^^^^^^
File "~/venv/flynt/lib64/python3.11/site-packages/flynt/transform/format_call_transforms.py", line 18, in joined_string
assert isinstance(fmt_call.func, ast.Attribute) and isinstance(
AssertionError
Traceback (most recent call last):
File "~/venv/flynt/lib64/python3.11/site-packages/flynt/transform/transform.py", line 32, in transform_chunk
converted, changed = fstringify_node(
^^^^^^^^^^^^^^^^
File "~/venv/flynt/lib64/python3.11/site-packages/flynt/transform/FstringifyTransformer.py", line 88, in fstringify_node
result = ft.visit(node)
^^^^^^^^^^^^^^
File "/opt/blue-python/3.11/lib64/python3.11/ast.py", line 418, in visit
return visitor(node)
^^^^^^^^^^^^^
File "~/venv/flynt/lib64/python3.11/site-packages/flynt/transform/FstringifyTransformer.py", line 31, in visit_Call
result_node = joined_string(
^^^^^^^^^^^^^^
File "~/venv/flynt/lib64/python3.11/site-packages/flynt/transform/format_call_transforms.py", line 18, in joined_string
assert isinstance(fmt_call.func, ast.Attribute) and isinstance(
AssertionError
fstringifying ~/t.py...no change
Running flynt v.1.0.1
Using following options: Namespace(verbose=True, quiet=False, no_multiline=False, line_length=88, dry_run=True, stdout=False, string=False, transform_percent=True, transform_format=True, transform_concats=False, transform_joins=False, fail_on_change=False, aggressive=False, exclude=None, src=['./t.py'], version=False)
Running flynt in dry-run mode. No files will be changed.
Flynt run has finished. Stats:
Execution time: 0.008s
Files checked: 1
Files modified: 0
_-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_._-_.
Please run your tests before committing. Did flynt get a perfect conversion? give it a star at:
~ https://github.com/ikamensh/flynt ~
Thank you for using flynt. Upgrade more projects and recommend it to your colleagues!
I can see why this would not work, but the traceback looks maybe a bit more scary than it needs to be?
The text was updated successfully, but these errors were encountered:
While investingating some non-transformed files, I came across this case:
When running
flynt
on this in verbose mode, the following output appears:I can see why this would not work, but the traceback looks maybe a bit more scary than it needs to be?
The text was updated successfully, but these errors were encountered: