mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
[PLW1507] Mark fix unsafe (#16343)
This commit is contained in:
parent
5bac4f6bd4
commit
42a5f5ef6a
3 changed files with 37 additions and 2 deletions
|
@ -2,3 +2,11 @@ import copy
|
|||
import os
|
||||
|
||||
copied_env = copy.copy(os.environ) # [shallow-copy-environ]
|
||||
|
||||
|
||||
# Test case where the proposed fix is wrong, i.e., unsafe fix
|
||||
# Ref: https://github.com/astral-sh/ruff/issues/16274#event-16423475135
|
||||
|
||||
os.environ["X"] = "0"
|
||||
env = copy.copy(os.environ)
|
||||
os.environ["X"] = "1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue