]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/thrift/test/crossrunner/compat.py
buildsys: switch source download to quincy
[ceph.git] / ceph / src / jaegertracing / thrift / test / crossrunner / compat.py
1 import os
2 import sys
3
4 if sys.version_info[0] == 2:
5 _ENCODE = sys.getfilesystemencoding()
6
7 def path_join(*args):
8 bin_args = map(lambda a: a.decode(_ENCODE), args)
9 return os.path.join(*bin_args).encode(_ENCODE)
10
11 def str_join(s, l):
12 bin_args = map(lambda a: a.decode(_ENCODE), l)
13 b = s.decode(_ENCODE)
14 return b.join(bin_args).encode(_ENCODE)
15
16 logfile_open = open
17
18 else:
19
20 path_join = os.path.join
21 str_join = str.join
22
23 def logfile_open(*args):
24 return open(*args, errors='replace')