Do not crash if total_seconds() is not implemented
Which is the case with Python 2.6. We could do the calculation ourselves, but this is not a very important feature.
This commit is contained in:
parent
1c773c7514
commit
819de1ace0
1 changed files with 2 additions and 1 deletions
|
|
@ -192,7 +192,8 @@ class BaseBrowser(object):
|
|||
if request.body is not None: # separate '' from None
|
||||
f.write('\n\n\n%s' % request.body)
|
||||
with open(response_filepath + '-response.txt', 'w') as f:
|
||||
f.write('Time: %3.3fs\n' % response.elapsed.total_seconds())
|
||||
if hasattr(response.elapsed, 'total_seconds'):
|
||||
f.write('Time: %3.3fs\n' % response.elapsed.total_seconds())
|
||||
f.write('%s %s\n\n\n' % (response.status_code, response.reason))
|
||||
for key, value in response.headers.iteritems():
|
||||
f.write('%s: %s\n' % (key, value))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue