Reindented according to new standard, without tabs.

Also added one more os2 specific piece of code, by Jeff Rush.
This commit is contained in:
Guido van Rossum 1997-12-05 21:24:30 +00:00
parent 63cf3960df
commit 61de0ac4bb
1 changed files with 129 additions and 115 deletions

View File

@ -158,6 +158,20 @@ except NameError:
else: else:
import UserDict 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): class _Environ(UserDict.UserDict):
def __init__(self, environ): def __init__(self, environ):
UserDict.UserDict.__init__(self) UserDict.UserDict.__init__(self)