diff options
Diffstat (limited to 'Lib/netrc.py')
-rw-r--r-- | Lib/netrc.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/netrc.py b/Lib/netrc.py index baf8f1d..f0ae48c 100644 --- a/Lib/netrc.py +++ b/Lib/netrc.py @@ -23,10 +23,7 @@ class netrc: def __init__(self, file=None): default_netrc = file is None if file is None: - try: - file = os.path.join(os.environ['HOME'], ".netrc") - except KeyError: - raise OSError("Could not find .netrc: $HOME is not set") from None + file = os.path.join(os.path.expanduser("~"), ".netrc") self.hosts = {} self.macros = {} with open(file) as fp: |