Skip to content

Commit

Permalink
Only restoring environment variables that were deleted.
Browse files Browse the repository at this point in the history
  • Loading branch information
ballenspectric committed Aug 26, 2024
1 parent 860fe2e commit cca9010
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xmextras/xm.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ def XMSessionContext():
finally:
session.end()

# Restore environment variables to their
# state from before the XMSession.
# Restore environment variables that were
# deleted during the XMSession. Leave
# modified environment variables alone.
for k, v in saved_env_vars.items():
os.environ[k] = v
if k not in os.environ:
os.environ[k] = v

def info(session):
'''
Expand Down

0 comments on commit cca9010

Please sign in to comment.