Repeated expressions in f-strings
danguetta opened this issue · comments
When an expression is repeated in an f-string, it is not obfuscated correctly.
MWE:
def test(): a = 1 b = 2 c = f"First number is {a}. Here it is again {a}. Second number is {b}"
Is obfuscated as
def test ():#line:1 O0O0OOO0O00OO0O00 =1 #line:2 OOO0O000OO0O0O00O =2 #line:3 OO00000OO0OO0O0O0 =f"First number is {O0O0OOO0O00OO0O00}. Here it is again {a}. Second number is {OOO0O000OO0O0O00O}"
@danguetta
It is difficult to repair in a short time.
This issue is caused by https://bugs.python.org/issue37458
Got it - thanks for the response. I'll wait for the fix to the main issue!