[FFmpeg-devel] [PATCH] Tools: drop hard dependency on python2

Michael Niedermayer michael at niedermayer.cc
Thu Aug 23 17:11:11 EEST 2018


On Thu, Aug 23, 2018 at 11:54:25AM +0200, Mayeul Cantan wrote:
> Some tools had an artificial dependency on python2: zmqshell.py and normalize.py
> 
> This patch changes the requested environment to a generic "python",
> and add parenthesis to the "print" calls. 2to3 shows no other
> modifications are needed, so I expect this to be okay.
> 
> Please note that this was untested.
> 
> ---
>  tools/normalize.py | 13 +++++++------
>  tools/zmqshell.py  |  7 ++++---
>  2 files changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/tools/normalize.py b/tools/normalize.py
> index 7d87c5e154..a550d06906 100755
> --- a/tools/normalize.py
> +++ b/tools/normalize.py
> @@ -1,4 +1,5 @@
> -#!/usr/bin/env python2
> +#!/usr/bin/env python
> +# This script is compatible both with python 2 and 3; please keep it so
> 
>  import sys, subprocess
> 
> @@ -7,7 +8,7 @@ if len(sys.argv) > 2:
>      encopt = sys.argv[2:-1]
>      ofile  = sys.argv[-1]
>  else:
> -    print 'usage: %s <input> [encode_options] <output>' % sys.argv[0]
> +    print('usage: %s <input> [encode_options] <output>' % sys.argv[0])
>      sys.exit(1)
> 
>  analysis_cmd  = 'ffprobe -v error -of compact=p=0:nk=1 '
> @@ -15,7 +16,7 @@ analysis_cmd += '-show_entries
> frame_tags=lavfi.r128.I -f lavfi '

this patch looks corrupted by newlines

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180823/ac15083d/attachment.sig>


More information about the ffmpeg-devel mailing list