This repository was archived by the owner on Jul 11, 2022. It is now read-only.
File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 22
22
23
23
from . import __version__
24
24
25
+ import six
25
26
26
27
# Max number of bits to use when generating random ID
27
28
MAX_ID_BITS = 64
33
34
DEFAULT_FLUSH_INTERVAL = 1
34
35
35
36
# Name of the HTTP header used to encode trace ID
36
- TRACE_ID_HEADER = b'uber-trace-id'
37
+ TRACE_ID_HEADER = 'uber-trace-id' if six . PY3 else b'uber-trace-id'
37
38
38
39
# Prefix for HTTP headers used to record baggage items
39
- BAGGAGE_HEADER_PREFIX = b'uberctx-'
40
+ BAGGAGE_HEADER_PREFIX = 'uberctx-' if six . PY3 else b'uberctx-'
40
41
41
42
# The name of HTTP header or a TextMap carrier key which, if found in the
42
43
# carrier, forces the trace to be sampled as "debug" trace. The value of the
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def test_constructor_nonblocking(self):
39
39
assert t .transport_sock .gettimeout () == 0
40
40
41
41
def test_write (self ):
42
- self .t .write ('hello' )
42
+ self .t .write (b 'hello' )
43
43
44
44
def test_isopen_when_open (self ):
45
45
assert self .t .isOpen () == True
@@ -52,4 +52,4 @@ def test_close(self):
52
52
self .t .close ()
53
53
with self .assertRaises (Exception ):
54
54
# Something bad should happen if we send on a closed socket..
55
- self .t .write ('hello' )
55
+ self .t .write (b 'hello' )
You can’t perform that action at this time.
0 commit comments