Skip to content

Commit 75412b3

Browse files
committed
Support os.environ.get
Signed-off-by: harupy <[email protected]>
1 parent 68cb5b3 commit 75412b3

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import os
22

33
env = os.getenv("SECRET_KEY", 1) # [invalid-envvar-default]
4+
env = os.environ.get("SECRET_KEY", 1) # [invalid-envvar-default]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import os
22

33
env = os.getenv("SECRET_KEY", "1")
4+
env = os.environ.get("SECRET_KEY", "1")

pylint/checkers/stdlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
THREADING_THREAD = "threading.Thread"
3131
COPY_COPY = "copy.copy"
3232
OS_ENVIRON = "os._Environ"
33-
ENV_GETTERS = ("os.getenv",)
33+
ENV_GETTERS = ("os.getenv", "os.environ.get")
3434
SUBPROCESS_POPEN = "subprocess.Popen"
3535
SUBPROCESS_RUN = "subprocess.run"
3636
OPEN_MODULE = {"_io", "pathlib", "pathlib._local"}

0 commit comments

Comments
 (0)