Nobuaki Sukegawa | 2de2700 | 2015-11-22 01:13:48 +0900 | [diff] [blame] | 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 | else: | ||||
17 | |||||
18 | path_join = os.path.join | ||||
19 | |||||
20 | def str_join(s, l): | ||||
21 | return s.join(l) |