---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLW1507 [*] Shallow copy of `os.environ` via `copy.copy(os.environ)`
 --> shallow_copy_environ.py:4:14
  |
2 | import os
3 |
4 | copied_env = copy.copy(os.environ)  # [shallow-copy-environ]
  |              ^^^^^^^^^^^^^^^^^^^^^
  |
help: Replace with `os.environ.copy()`
  |
3 |
  - copied_env = copy.copy(os.environ)  # [shallow-copy-environ]
4 + copied_env = os.environ.copy()  # [shallow-copy-environ]
5 |
  |
note: This is an unsafe fix and may change runtime behavior

PLW1507 [*] Shallow copy of `os.environ` via `copy.copy(os.environ)`
  --> shallow_copy_environ.py:11:7
   |
10 | os.environ["X"] = "0"
11 | env = copy.copy(os.environ)
   |       ^^^^^^^^^^^^^^^^^^^^^
12 | os.environ["X"] = "1"
   |
help: Replace with `os.environ.copy()`
   |
10 | os.environ["X"] = "0"
   - env = copy.copy(os.environ)
11 + env = os.environ.copy()
12 | os.environ["X"] = "1"
   |
note: This is an unsafe fix and may change runtime behavior
