Fixes python3 compatibility issue
authorMher Movsisyan <mher.movsisyan@gmail.com>
Mon, 28 May 2012 09:11:59 +0000 (14:11 +0500)
committerMher Movsisyan <mher.movsisyan@gmail.com>
Mon, 28 May 2012 09:11:59 +0000 (14:11 +0500)
requests/models.py

index 94e6e036b489c1db7a8ef066c6b6bdf8e4de57da..92cb722ff6b39526b982af2dc416eae35fec763a 100644 (file)
@@ -9,7 +9,6 @@ This module contains the primary objects that power Requests.
 
 import json
 import os
-import string
 from datetime import datetime
 
 from .hooks import dispatch_hook, HOOKS
@@ -522,7 +521,7 @@ class Request(object):
             self.headers['Content-Type'] = content_type
 
         _p = urlparse(url)
-        no_proxy = filter(string.strip, self.proxies.get('no', '').split(','))
+        no_proxy = filter(lambda x:x.strip(), self.proxies.get('no', '').split(','))
         proxy = self.proxies.get(_p.scheme)
 
         if proxy and not any(map(_p.netloc.endswith, no_proxy)):