Show More
@@ -79,6 +79,20 b' def hfsignoreclean(s):' | |||
|
79 | 79 | _nativeenviron = os.supports_bytes_environ |
|
80 | 80 | if _nativeenviron: |
|
81 | 81 | environ = os.environb # re-exports |
|
82 | if pycompat.sysplatform == b'OpenVMS': | |
|
83 | # workaround for a bug in VSI 3.10 port | |
|
84 | # os.environb is only populated with a few Predefined symbols | |
|
85 | def newget(self, key, default=None): | |
|
86 | # pytype on linux does not understand OpenVMS special modules | |
|
87 | import _decc # pytype: disable=import-error | |
|
88 | ||
|
89 | v = _decc.getenv(key, None) | |
|
90 | if isinstance(key, bytes): | |
|
91 | return default if v is None else v.encode('latin-1') | |
|
92 | else: | |
|
93 | return default if v is None else v | |
|
94 | ||
|
95 | environ.__class__.get = newget | |
|
82 | 96 | else: |
|
83 | 97 | # preferred encoding isn't known yet; use utf-8 to avoid unicode error |
|
84 | 98 | # and recreate it once encoding is settled |
General Comments 0
You need to be logged in to leave comments.
Login now