]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
Make hosts_to_ignore a set() earlier for clarity.
authorAron Griffis <aron@arongriffis.com>
Sun, 23 Aug 2015 14:29:02 +0000 (10:29 -0400)
committerAron Griffis <aron@arongriffis.com>
Sun, 23 Aug 2015 20:00:52 +0000 (16:00 -0400)
vcr/config.py

index 030462a77b05cc8158539e9547c04d7592ecb5a4..a94520f5867135a27afe5773a7cc8cf6306641f1 100644 (file)
@@ -211,12 +211,10 @@ class VCR(object):
                 )
             )
 
-        hosts_to_ignore = list(ignore_hosts)
+        hosts_to_ignore = set(ignore_hosts)
         if ignore_localhost:
-            hosts_to_ignore.extend(('localhost', '0.0.0.0', '127.0.0.1'))
-
+            hosts_to_ignore.update(('localhost', '0.0.0.0', '127.0.0.1'))
         if hosts_to_ignore:
-            hosts_to_ignore = set(hosts_to_ignore)
             filter_functions.append(self._build_ignore_hosts(hosts_to_ignore))
 
         if before_record_request: