1. cherrypy
  2. CherryPy

Commits

Robert Brewer  committed 9ede37e

Fix for #524 (tests fail on python < 2.4).

  • Participants
  • Parent commits 96286a7
  • Branches cherrypy-2.x

Comments (0)

Files changed (1)

File cherrypy/test/webtest.py

View file
             conn = http_conn(host, port)
             conn._http_vsn_str = protocol
             conn._http_vsn = int("".join([x for x in protocol if x.isdigit()]))
-            conn.putrequest(method.upper(), url,
-                            skip_host=True, skip_accept_encoding=True)
+            
+            # skip_accept_encoding argument added in python version 2.4
+            if sys.version_info < (2, 4):
+                conn.putrequest(method.upper(), url, skip_host=True)
+            else:
+                conn.putrequest(method.upper(), url, skip_host=True,
+                                skip_accept_encoding=True)
             
             for key, value in headers:
                 conn.putheader(key, value)