mirror of https://github.com/python/cpython
Reindented according to new standard, without tabs.
Also added one more os2 specific piece of code, by Jeff Rush.
This commit is contained in:
parent
63cf3960df
commit
61de0ac4bb
14
Lib/os.py
14
Lib/os.py
|
@ -158,6 +158,20 @@ except NameError:
|
|||
else:
|
||||
import UserDict
|
||||
|
||||
if name in ('os2', ): # Where Env Var Names Must Be UPPERCASE
|
||||
import string
|
||||
class _Environ(UserDict.UserDict):
|
||||
def __init__(self, environ):
|
||||
UserDict.UserDict.__init__(self)
|
||||
self.data = environ
|
||||
def __setitem__(self, key, item):
|
||||
key = string.upper(key)
|
||||
putenv(key, item)
|
||||
self.data[key] = item
|
||||
def __getitem__(self, key):
|
||||
return self.data[string.upper(key)]
|
||||
|
||||
else: # Where Env Var Names Can Be Mixed Case
|
||||
class _Environ(UserDict.UserDict):
|
||||
def __init__(self, environ):
|
||||
UserDict.UserDict.__init__(self)
|
||||
|
|
Loading…
Reference in New Issue