[jsinterp] Fix dict comprehension for Py2.6
authordirkf <fieldhouse@gmx.net>
Sun, 19 Feb 2023 13:47:49 +0000 (13:47 +0000)
committerdirkf <fieldhouse@gmx.net>
Sun, 19 Feb 2023 13:48:58 +0000 (13:48 +0000)
Resolves #31600

youtube_dl/jsinterp.py

index 60fa2b1b9d92c0283e885382adefba6375837358..a3bc42a61634569c7d4b49639d71e4476076a0e0 100644 (file)
@@ -262,7 +262,7 @@ class JSInterpreter(object):
         if not expr:
             return
         # collections.Counter() is ~10% slower in both 2.7 and 3.9
-        counters = {k: 0 for k in _MATCHING_PARENS.values()}
+        counters = dict((k, 0) for k in _MATCHING_PARENS.values())
         start, splits, pos, delim_len = 0, 0, 0, len(delim) - 1
         in_quote, escaping, skipping = None, False, 0
         after_op, in_regex_char_group, skip_re = True, False, 0