Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/variables.py @ 242:bfa4d125fd14
FIX: The namespace lookup implementation for the "OS" namespace did not properly handle the "default" argument.
It has been ignored entirely.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Thu, 21 May 2020 08:19:03 +0200 |
| parents | 13711ba8e81e |
| children | 57ff12610dc5 |
comparison
equal
deleted
inserted
replaced
| 241:f3c3bfc2bcbe | 242:bfa4d125fd14 |
|---|---|
| 34 | 34 |
| 35 def _oslookup(name, default=_MARKER): | 35 def _oslookup(name, default=_MARKER): |
| 36 """Lookup some process and/or OS state """ | 36 """Lookup some process and/or OS state """ |
| 37 if name == "cwd": | 37 if name == "cwd": |
| 38 return native_os_str_to_text(os.getcwd()) | 38 return native_os_str_to_text(os.getcwd()) |
| 39 raise KeyError("key %r not found in the namespace" % name) | 39 else: |
| 40 if default is _MARKER: | |
| 41 raise KeyError("key %r not found in the namespace" % name) | |
| 42 else: | |
| 43 return default | |
| 40 | 44 |
| 41 | 45 |
| 42 def _pylookup(name, default=_MARKER): | 46 def _pylookup(name, default=_MARKER): |
| 43 """Lookup Python specific information""" | 47 """Lookup Python specific information""" |
| 44 import platform | 48 import platform |
