issue #477: fix 3.x failure in new target.set_file_mode() function.

This commit is contained in:
David Wilson 2019-01-23 12:44:08 +00:00
parent 51294db52d
commit aa5d37af89
1 changed files with 3 additions and 1 deletions

View File

@ -722,7 +722,9 @@ def set_file_mode(path, spec, fd=None):
"""
Update the permissions of a file using the same syntax as chmod(1).
"""
if isinstance(spec, (int, long)):
if isinstance(spec, int):
new_mode = spec
elif mitogen.core.PY2 and isinstance(spec, long):
new_mode = spec
elif spec.isdigit():
new_mode = int(spec, 8)