Issue
From the documentation:
If the platform supports the
unsetenv()
function, you can delete items in this mapping to unset environment variables.unsetenv()
will be called automatically when an item is deleted from os.environ, and when one of thepop()
orclear()
methods is called.
However I want something that will work regardless of the availability of unsetenv()
. How do I delete items from the mapping if it's not available? os.environ['MYVAR'] = None
?
Solution
Just
del os.environ['MYVAR']
should work.
Answered By - Vinay Sajip Answer Checked By - Candace Johnson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.