8000 Add platform information to python user-agent · Twilio-api/twilio-python@d722c39 · GitHub
[go: up one dir, main page]

Skip to content

Commit d722c39

Browse files
author
Kevin Burke
committed
Add platform information to python user-agent
1 parent 8f0bda5 commit d722c39

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Develop Branch
77
--------------
88

99
- Remove unittest2 dependency.
10+
- Tests no longer run against Python 2.5.
1011

1112
Version 3.6.4
1213
-------------

twilio/rest/resources/base.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
import os
3+
import platform
34
import sys
45

56
from six import integer_types, string_types, binary_type, iteritems, u
@@ -114,7 +115,12 @@ def make_twilio_request(method, uri, **kwargs):
114115
or 500-level response.
115116
"""
116117
headers = kwargs.get("headers", {})
117-
headers["User-Agent"] = "twilio-python/%s" % twilio.__version__
118+
119+
user_agent = "twilio-python/%s (Python %s)" % (
120+
twilio.__version__,
121+
platform.python_version(),
122+
)
123+
headers["User-Agent"] = user_agent
118124
headers["Accept-Charset"] = "utf-8"
119125

120126
if method == "POST" and "Content-Type" not in headers:

0 commit comments

Comments
 (0)
0