Trap OSError when deleting env vars
On the other OS, it seems that case insensitivity for
environment vars can bite users when using some unknown
combination of python 2.4.1 and win2kSP4+minsys (and
probably other vversions of these softwares).
The best way to avoid problems in those weird cases is to
ignore OSError exception during env var deletion.
--- a/mercurial/hg.py Mon Aug 08 19:49:48 2005 -0800
+++ b/mercurial/hg.py Tue Aug 09 09:36:34 2005 -0800
@@ -1781,8 +1781,11 @@
# Note: urllib2 takes proxy values from the environment and those will
# take precedence
for env in ["HTTP_PROXY", "http_proxy", "no_proxy"]:
- if os.environ.has_key(env):
- del os.environ[env]
+ try:
+ if os.environ.has_key(env):
+ del os.environ[env]
+ except OSError:
+ pass
proxy_handler = urllib2.BaseHandler()
if host and not no_proxy: