Skip to content
This repository was archived by the owner on Jul 11, 2022. It is now read-only.

Commit 532eba6

Browse files
committed
[py3] Revert change from long -> int
Use `long` for py2, and `int` for py3. Otherwise we will get an integer overflow for py2 32bit.
1 parent e21d2f9 commit 532eba6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jaeger_client/thrift.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# THE SOFTWARE.
2020

2121
from past.builtins import basestring
22+
import six
2223
import socket
2324
import struct
2425

@@ -34,6 +35,9 @@
3435
_max_signed_id = (1 << 63) - 1
3536
_max_unsigned_id = (1 << 64)
3637

38+
if six.PY3:
39+
long = int
40+
3741

3842
def ipv4_to_int(ipv4):
3943
if ipv4 == 'localhost':
@@ -118,7 +122,7 @@ def timestamp_micros(ts):
118122
:param ts:
119123
:return:
120124
"""
121-
return int(ts * 1000000)
125+
return long(ts * 1000000)
122126

123127

124128
def make_zipkin_spans(spans):

0 commit comments

Comments
 (0)