Show More
@@ -16,6 +16,22 checks = { | |||
|
16 | 16 | "false": (lambda: False, "nail clipper"), |
|
17 | 17 | } |
|
18 | 18 | |
|
19 | if sys.version_info[0] >= 3: | |
|
20 | def _bytespath(p): | |
|
21 | if p is None: | |
|
22 | return p | |
|
23 | return p.encode('utf-8') | |
|
24 | ||
|
25 | def _strpath(p): | |
|
26 | if p is None: | |
|
27 | return p | |
|
28 | return p.decode('utf-8') | |
|
29 | else: | |
|
30 | def _bytespath(p): | |
|
31 | return p | |
|
32 | ||
|
33 | _strpath = _bytespath | |
|
34 | ||
|
19 | 35 | def check(name, desc): |
|
20 | 36 | """Registers a check function for a feature.""" |
|
21 | 37 | def decorator(func): |
@@ -360,7 +376,7 def has_hardlink(): | |||
|
360 | 376 | os.close(fh) |
|
361 | 377 | name = tempfile.mktemp(dir='.', prefix=tempprefix) |
|
362 | 378 | try: |
|
363 | util.oslink(fn, name) | |
|
379 | util.oslink(_bytespath(fn), _bytespath(name)) | |
|
364 | 380 | os.unlink(name) |
|
365 | 381 | return True |
|
366 | 382 | except OSError: |
General Comments 0
You need to be logged in to leave comments.
Login now