diff options
author | Éric Araujo <merwok@netwok.org> | 2011-03-26 00:24:47 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-03-26 00:24:47 (GMT) |
commit | 8bea9a5b13330ea0f18652cdfec3ae15488d7e9d (patch) | |
tree | 8a47ffaf245ae217e4ca4bc236e0170a31d5cfed | |
parent | 9aa5a34b6b38ef9eec67f80a8f105c8c5a7a9c10 (diff) | |
download | cpython-8bea9a5b13330ea0f18652cdfec3ae15488d7e9d.zip cpython-8bea9a5b13330ea0f18652cdfec3ae15488d7e9d.tar.gz cpython-8bea9a5b13330ea0f18652cdfec3ae15488d7e9d.tar.bz2 |
Use universal construct os.path.expanduser('~') instead of os.environ['HOME']
-rw-r--r-- | Doc/library/cookielib.rst | 2 | ||||
-rw-r--r-- | Doc/library/readline.rst | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/cookielib.rst b/Doc/library/cookielib.rst index 47211c9..4ca0471 100644 --- a/Doc/library/cookielib.rst +++ b/Doc/library/cookielib.rst @@ -750,7 +750,7 @@ cookies (assumes Unix/Netscape convention for location of the cookies file):: import os, cookielib, urllib2 cj = cookielib.MozillaCookieJar() - cj.load(os.path.join(os.environ["HOME"], ".netscape/cookies.txt")) + cj.load(os.path.join(os.path.expanduser("~"), ".netscape", "cookies.txt")) opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) r = opener.open("http://example.com/") diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index f6e855e..64c61a2 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -211,7 +211,7 @@ normally be executed automatically during interactive sessions from the user's import os import readline - histfile = os.path.join(os.environ["HOME"], ".pyhist") + histfile = os.path.join(os.path.expanduser("~"), ".pyhist") try: readline.read_history_file(histfile) except IOError: |