]> granicus.if.org Git - python/commitdiff
open_http also had the 'data is None' test backwards. don't call with the
authorGuido van Rossum <guido@python.org>
Tue, 9 Mar 1999 19:31:21 +0000 (19:31 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 9 Mar 1999 19:31:21 +0000 (19:31 +0000)
extra argument if data is None.

Lib/urllib.py

index 7319bd623fae44160fd4e2ece7bc86eeb343b118..ceacc61303dcc4cbe7a1ba62dd56eacbafbcfb31 100644 (file)
@@ -276,10 +276,9 @@ class URLopener:
             return addinfourl(fp, headers, "http:" + url)
         else:
             if data is None:
-                return self.http_error(url, fp, errcode, errmsg,
-                                       headers, data)
-            else:
                 return self.http_error(url, fp, errcode, errmsg, headers)
+            else:
+                return self.http_error(url, fp, errcode, errmsg, headers, data)
 
     # Handle http errors.
     # Derived class can override this, or provide specific handlers