diff options
author | Victor Stinner <vstinner@python.org> | 2020-01-21 15:13:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-21 15:13:09 (GMT) |
commit | 56cd3710a1ea3ba872d345ea1bebc86ed08bc8b8 (patch) | |
tree | 53e622226ec54c95227e9c36011b7326fb918899 /Lib | |
parent | 59e2d26b258c12f18d8d2e789ef741703d6c52d5 (diff) | |
download | cpython-56cd3710a1ea3ba872d345ea1bebc86ed08bc8b8.zip cpython-56cd3710a1ea3ba872d345ea1bebc86ed08bc8b8.tar.gz cpython-56cd3710a1ea3ba872d345ea1bebc86ed08bc8b8.tar.bz2 |
bpo-39413: Implement os.unsetenv() on Windows (GH-18104)
The os.unsetenv() function is now also available on Windows.
It is implemented with SetEnvironmentVariableW(name, NULL).
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_os.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 82c441c..50535da 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -956,14 +956,9 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol): # On OS X < 10.6, unsetenv() doesn't return a value (bpo-13415). @support.requires_mac_ver(10, 6) def test_unset_error(self): - if sys.platform == "win32": - # an environment variable is limited to 32,767 characters - key = 'x' * 50000 - self.assertRaises(ValueError, os.environ.__delitem__, key) - else: - # "=" is not allowed in a variable name - key = 'key=' - self.assertRaises(OSError, os.environ.__delitem__, key) + # "=" is not allowed in a variable name + key = 'key=' + self.assertRaises(OSError, os.environ.__delitem__, key) def test_key_type(self): missing = 'missingkey' |