Skip to content

Commit

Permalink
Handle bytes when listing fonts in VideoClip.py (#306)
Browse files Browse the repository at this point in the history
Handle bytes when listing fonts in VideoClip.py
  • Loading branch information
Zowie authored and bearney74 committed Feb 22, 2017
1 parent 32b7007 commit df31c03
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions moviepy/video/VideoClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,9 +1202,12 @@ def list(arg):
lines = result.splitlines()

if arg == 'font':
return [l[8:] for l in lines if l.startswith(" Font:")]
return [l.decode('UTF-8')[8:] for l in lines if l.startswith(b" Font:")]
elif arg == 'color':
return [l.split(" ")[1] for l in lines[2:]]
return [l.split(b" ")[0] for l in lines[2:]]
else:
raise Exception("Moviepy:Error! Argument must equal "
"'font' or 'color'")

@staticmethod
def search(string, arg):
Expand Down

0 comments on commit df31c03

Please sign in to comment.