Skip to content

Commit d13030b

Browse files
committed
Switch to using a sentinel()
1 parent 39193be commit d13030b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/os.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def get_exec_path(env=None):
722722

723723
# Sentinel used for seeing if a value is found within the internal _Environ
724724
# dictionary.
725-
_environ_missing = object()
725+
_MISSING = sentinel("MISSING")
726726

727727

728728
class _Environ(MutableMapping):
@@ -779,8 +779,8 @@ def copy(self):
779779
return dict(self)
780780

781781
def get(self, key, default = None):
782-
val = self._data.get(self.encodekey(key), _environ_missing)
783-
return default if val is _environ_missing else self.decodevalue(val)
782+
val = self._data.get(self.encodekey(key), _MISSING)
783+
return default if val is _MISSING else self.decodevalue(val)
784784

785785
def setdefault(self, key, value):
786786
if key not in self:

0 commit comments

Comments
 (0)