Skip to content
This repository was archived by the owner on Jun 13, 2023. It is now read-only.

Commit 174955c

Browse files
authored
Fixing disable epsagon env var value check (#328)
1 parent 475c87c commit 174955c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

epsagon/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ def _inner_wrapper(func):
4646
return _inner_wrapper
4747

4848

49-
if os.getenv('DISABLE_EPSAGON') == 'TRUE':
49+
if (
50+
os.getenv('DISABLE_EPSAGON') and
51+
os.getenv('DISABLE_EPSAGON').upper() == 'TRUE'
52+
):
5053
os.environ['DISABLE_EPSAGON_PATCH'] = 'TRUE'
5154
lambda_wrapper = dummy_wrapper # pylint: disable=C0103
5255
step_lambda_wrapper = dummy_wrapper # pylint: disable=C0103
@@ -97,5 +100,8 @@ def _inner_wrapper(func):
97100

98101

99102
# The modules are patched only if DISABLE_EPSAGON_PATCH variable is NOT 'TRUE'
100-
if os.getenv('DISABLE_EPSAGON_PATCH') != 'TRUE':
103+
if (
104+
not os.getenv('DISABLE_EPSAGON_PATCH') or
105+
os.getenv('DISABLE_EPSAGON_PATCH').upper() != 'TRUE'
106+
):
101107
patch_all()

0 commit comments

Comments
 (0)