diff options
author | wm4 <wm4@nowhere> | 2014-04-29 02:21:59 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-29 02:21:59 +0200 |
commit | 8562f53cf95d30c8de64bd0049a8635413c46e91 (patch) | |
tree | c7368f1dd19a74c199ccf7d1371b42a0c4090660 /TOOLS | |
parent | 2a8f7181e3fa90df5859b6139e448ff7505fdd84 (diff) | |
download | mpv-8562f53cf95d30c8de64bd0049a8635413c46e91.tar.bz2 mpv-8562f53cf95d30c8de64bd0049a8635413c46e91.tar.xz |
TOOLS/umpv: make it work with Python 3 (again)
Apparently, the 3rd (2nd) parameter to string.translate() function was
removed.
Also, make_abs() had a mistake - not sure how this passed testing.
Diffstat (limited to 'TOOLS')
-rwxr-xr-x | TOOLS/umpv | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/TOOLS/umpv b/TOOLS/umpv index f2e4ff3c7a..69aeb8a54a 100755 --- a/TOOLS/umpv +++ b/TOOLS/umpv @@ -56,13 +56,16 @@ def is_url(filename): return False # protocol prefix has no special characters => it's an URL prefix = parts[0] - return len(prefix.translate(None, string.letters)) == 0 + for c in prefix: + if string.ascii_letters.find(c) < 0: + return False + return True # make them absolute; also makes them safe against interpretation as options def make_abs(filename): if not is_url(filename): - return os.path.abspath(f) - return f + return os.path.abspath(filename) + return filename files = [make_abs(f) for f in files] opts_env = os.getenv("UMPV_OPTIONS") |