File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
name = "ipregistry"
2
2
3
- from .version import __version__
4
-
5
3
from .cache import *
6
4
from .core import *
7
5
from .json import *
Original file line number Diff line number Diff line change 13
13
See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
"""
16
-
16
+ import importlib
17
17
import json
18
18
import sys
19
19
import urllib .parse
@@ -248,8 +248,15 @@ def __create_api_error(response):
248
248
raise ClientError ("HTTP Error occurred, but no response was received." )
249
249
250
250
def __headers (self ):
251
+ python_version = sys .version .split ()[0 ]
252
+ lib_version = importlib .metadata .version ('ipregistry' )
251
253
return {
252
254
"authorization" : "ApiKey " + self ._config .api_key ,
253
255
"content-type" : "application/json" ,
254
- "user-agent" : "Ipregistry/Python" + str (sys .version_info [0 ]) + "/" + __version__
256
+ "user-agent" :
257
+ "Ipregistry/" +
258
+ lib_version +
259
+ " (Library; Python/" +
260
+ python_version +
261
+ "; +https://github.com/ipregistry/ipregistry-python)"
255
262
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments