summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-03-29 17:16:58 +0100
committerArthur de Jong <arthur@arthurdejong.org>2013-03-29 17:21:54 +0100
commit65a65adbf953ee8da43a76db2cd03a064a80cd46 (patch)
tree3cb662dae984c66f43370031e57990d1ed346086
parent46cf240eff487be2cdbe86439805f3adb8f570ef (diff)
Switch to using os.environ instead of os.putenv()
The os.putenv() call doesn't update os.environ and Python documentation recommends using os.environ.
-rwxr-xr-xpynslcd/pynslcd.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pynslcd/pynslcd.py b/pynslcd/pynslcd.py
index 6c2d28a..0082f24 100755
--- a/pynslcd/pynslcd.py
+++ b/pynslcd/pynslcd.py
@@ -252,9 +252,9 @@ if __name__ == '__main__':
parse_cmdline()
# clean the environment
os.environ.clear()
- os.putenv('HOME', '/')
- os.putenv('TMPDIR', '/tmp')
- os.putenv('LDAPNOINIT', '1')
+ os.environ['HOME'] = '/'
+ os.environ['TMPDIR'] = '/tmp'
+ os.environ['LDAPNOINIT'] = '1'
# set log level
if debugging:
logging.getLogger().setLevel(logging.DEBUG)