From: dirkf Date: Sun, 19 Feb 2023 13:47:49 +0000 (+0000) Subject: [jsinterp] Fix dict comprehension for Py2.6 X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=57802e632f5a741df6fd9b30a455c32632944489;p=youtube-dl [jsinterp] Fix dict comprehension for Py2.6 Resolves #31600 --- diff --git a/youtube_dl/jsinterp.py b/youtube_dl/jsinterp.py index 60fa2b1b9..a3bc42a61 100644 --- a/youtube_dl/jsinterp.py +++ b/youtube_dl/jsinterp.py @@ -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