projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5333ec9
)
Fix for user-agent setting
author
Pavel Dmitriev
<p.dmitriev@nimble.com>
Tue, 13 Nov 2012 15:40:13 +0000
(17:40 +0200)
committer
Pavel Dmitriev
<p.dmitriev@nimble.com>
Tue, 13 Nov 2012 15:40:13 +0000
(17:40 +0200)
requests/utils.py
patch
|
blob
|
history
diff --git
a/requests/utils.py
b/requests/utils.py
index
ec9f4d2
..
b3d33f4
100644
(file)
--- a/
requests/utils.py
+++ b/
requests/utils.py
@@
-539,11
+539,18
@@
def default_user_agent():
_implementation_version = platform.python_version() # Complete Guess
else:
_implementation_version = 'Unknown'
+
+ try:
+ p_system = platform.system()
+ p_release = platform.release()
+ except IOError:
+ p_system = 'Unknown'
+ p_release = 'Unknown'
return " ".join([
'python-requests/%s' % __version__,
'%s/%s' % (_implementation, _implementation_version),
- '%s/%s' % (p
latform.system(), platform.release()
),
+ '%s/%s' % (p
_system, p_release
),
])