summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-04-29 02:21:59 +0200
committerwm4 <wm4@nowhere>2014-04-30 11:45:32 +0200
commitc78142a973827b9e6f9d8361c7a1e3d1050a5bfb (patch)
treeb624e2c5bfb749f5cc1bac541dc84ce6b4bcd45e
parenta8e6caf56b2de80e1bdad18432d5d58e9b696748 (diff)
downloadmpv-c78142a973827b9e6f9d8361c7a1e3d1050a5bfb.tar.bz2
mpv-c78142a973827b9e6f9d8361c7a1e3d1050a5bfb.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.
-rwxr-xr-xTOOLS/umpv9
1 files changed, 6 insertions, 3 deletions
diff --git a/TOOLS/umpv b/TOOLS/umpv
index aaa5d1cd1b..16c1bcacfa 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")