浏览代码

[jsinterp] Fix test for failed match in extract_object()

dirkf 2 年之前
父节点
当前提交
ff75c300f5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      youtube_dl/jsinterp.py

+ 1 - 1
youtube_dl/jsinterp.py

@@ -985,9 +985,9 @@ class JSInterpreter(object):
                 \((?P<args>[^)]*)\)\s*
                 (?P<code>{.+})''' % {'name': re.escape(funcname)},
             self.code)
-        code, _ = self._separate_at_paren(func_m.group('code'))  # refine the match
         if func_m is None:
             raise self.Exception('Could not find JS function "{funcname}"'.format(**locals()))
+        code, _ = self._separate_at_paren(func_m.group('code'))  # refine the match
         return self.build_arglist(func_m.group('args')), code
 
     def extract_function(self, funcname):