Commits

Hugo Lopes Tavares committed 34d83fd

in python2.6 there is a response.code, but it is None, and we need to change its value to 200.

Comments (0)

Files changed (1)

tests/pypi_server.py

         fp = open(filepath, 'wb')
         # when it uses file:// scheme, code is None and there is no msg attr
         # but it has been successfully opened
-        status = '%s %s' % (getattr(response, 'code', 200), getattr(response, 'msg', 'OK'))
+        status = '%s %s' % (getattr(response, 'code', 200) or 200, getattr(response, 'msg', 'OK'))
         headers = ['%s: %s' % (key, value) for key, value in response.headers.items()]
         body = response.read()
         fp.write('\n'.join([status] + headers + ['', body]))