Fix for AppEngine
authorSamuel Hug <samuel.b.hug@gmail.com>
Mon, 28 Oct 2013 16:51:56 +0000 (09:51 -0700)
committerSamuel Hug <samuel.b.hug@gmail.com>
Mon, 28 Oct 2013 16:51:56 +0000 (09:51 -0700)
requests/utils.py

index 5000105a65e9aaa2f2892db7f3ce9e7a79b6e4f4..4283560ef2a1d16b3647472196e83e9bb94ada43 100644 (file)
@@ -17,7 +17,6 @@ import os
 import platform
 import re
 import sys
-from netrc import netrc, NetrcParseError
 
 from . import __version__
 from . import certs
@@ -67,6 +66,8 @@ def get_netrc_auth(url):
     """Returns the Requests tuple auth for a given url from netrc."""
 
     try:
+        from netrc import netrc, NetrcParseError
+
         locations = (os.path.expanduser('~/{0}'.format(f)) for f in NETRC_FILES)
         netrc_path = None