-
Notifications
You must be signed in to change notification settings - Fork 176
Closed
Labels
affected-version:0.19bugUnexpected or incorrect user-visible behaviorUnexpected or incorrect user-visible behaviorextract-refactorgood first issueneedinfo
Milestone
Description
I've uploaded this commit with two failing teststhis commit with one failing test case which, one just fails to refactor correctly, the other raises an exception because(?) the source code doesn't exactly match the AST, i.e.:
with open("test") as file1, open("test") as file2:
print(file1, file2)fails to parse; there is a second (nested) with node in the AST, but in _Source.consume/patchedast.py:643 the self.offset is at the end of the line and couldn't match a second, non-existent with anyway.
with open("test") as file1:
with open("test") as file2:
print(file1, file2)will refactor (and miss the two variables) to:
def extracted():
print(file1, file2)
with open("test") as file1:
with open("test") as file2:
extracted()I'm pretty sure I can figure out the second case, but for the first I'm at a loss how to start fixing it. Any pointers?
Edit: I've changed the one test case to reflect the working behaviour with the added global_ flag.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affected-version:0.19bugUnexpected or incorrect user-visible behaviorUnexpected or incorrect user-visible behaviorextract-refactorgood first issueneedinfo