Skip to content
Myr

Merge pull request #2803 from asieira/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Update default user-agent (#2785)

authored by Ian Cordasco · committed by Ian Cordasco · parents d996a95, 4e44c2a · Browse files · 1 file+1 added−27 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−27 removed

  • other:+1 added−27 removed

1 file+1 added−27 removed

modified:requests/utils.py+1 added-27 removed
552 unmodified lines
553 return proxy554555def default_user_agent(name="python-requests"):556 """Return a string representing the default user agent."""557 _implementation = platform.python_implementation()557 return '%s/%s' % (name, __version__)558559 if _implementation == 'CPython':560 _implementation_version = platform.python_version()561 elif _implementation == 'PyPy':562 _implementation_version = '%s.%s.%s' % (sys.pypy_version_info.major,563 sys.pypy_version_info.minor,564 sys.pypy_version_info.micro)565 if sys.pypy_version_info.releaselevel != 'final':566 _implementation_version = ''.join([_implementation_version, sys.pypy_version_info.releaselevel])567 elif _implementation == 'Jython':568 _implementation_version = platform.python_version() # Complete Guess569 elif _implementation == 'IronPython':570 _implementation_version = platform.python_version() # Complete Guess571 else:572 _implementation_version = 'Unknown'559574 try:575 p_system = platform.system()576 p_release = platform.release()577 except IOError:578 p_system = 'Unknown'579 p_release = 'Unknown'580581 return " ".join(['%s/%s' % (name, __version__),582 '%s/%s' % (_implementation, _implementation_version),583 '%s/%s' % (p_system, p_release)])584585560def default_headers():561 return CaseInsensitiveDict({562 'User-Agent': default_user_agent(),563 'Accept-Encoding': ', '.join(('gzip', 'deflate')),
133 unmodified lines