mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 17:39:38 +00:00
matroska.py: remove python2 support
Since 0.33.0 mpv does not support python2. This commit removes python2 support from the file completely with the following changes: - __future__ import of print_function is python2 only - unicode literals are legacy in python3 - 'sys.version_info.major < 3' check is redundant
This commit is contained in:
parent
d7e80dee26
commit
8886f017a1
@ -21,8 +21,6 @@ Can also be used to directly parse Matroska files and display their contents.
|
|||||||
# License along with mpv. If not, see <http://www.gnu.org/licenses/>.
|
# License along with mpv. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
# for compatibility with Python 2.x
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
elements_ebml = (
|
elements_ebml = (
|
||||||
'EBML, 1a45dfa3, sub', (
|
'EBML, 1a45dfa3, sub', (
|
||||||
@ -300,8 +298,8 @@ parse_elems(elements_ebml, 'EBML')
|
|||||||
parse_elems(elements_matroska, 'MATROSKA')
|
parse_elems(elements_matroska, 'MATROSKA')
|
||||||
|
|
||||||
def printf(out, *args):
|
def printf(out, *args):
|
||||||
out.write(u' '.join([str(x) for x in args]))
|
out.write(' '.join(str(x) for x in args))
|
||||||
out.write(u'\n')
|
out.write('\n')
|
||||||
|
|
||||||
def generate_C_header(out):
|
def generate_C_header(out):
|
||||||
printf(out, '// Generated by TOOLS/matroska.py, do not edit manually')
|
printf(out, '// Generated by TOOLS/matroska.py, do not edit manually')
|
||||||
@ -466,8 +464,6 @@ if __name__ == "__main__":
|
|||||||
elif sys.argv[1] == '--generate-definitions':
|
elif sys.argv[1] == '--generate-definitions':
|
||||||
generate_C_definitions(sys.stdout)
|
generate_C_definitions(sys.stdout)
|
||||||
else:
|
else:
|
||||||
if sys.version_info.major < 3:
|
|
||||||
raise Exception("Dumping requires Python 3.")
|
|
||||||
s = open(sys.argv[1], "rb")
|
s = open(sys.argv[1], "rb")
|
||||||
while 1:
|
while 1:
|
||||||
start = s.tell()
|
start = s.tell()
|
||||||
|
Loading…
Reference in New Issue
Block a user