[jsinterp] Nits
authordirkf <fieldhouse@gmx.net>
Sat, 4 Feb 2023 01:53:47 +0000 (01:53 +0000)
committerdirkf <fieldhouse@gmx.net>
Sun, 12 Feb 2023 22:16:00 +0000 (22:16 +0000)
youtube_dl/jsinterp.py

index 1e7b342ac66ac1eccfefdeba57901ff47cbd8a65..60fa2b1b9d92c0283e885382adefba6375837358 100644 (file)
@@ -201,7 +201,7 @@ class JSInterpreter(object):
         def __init__(self, msg, *args, **kwargs):
             expr = kwargs.pop('expr', None)
             if expr is not None:
-                msg = '{0} in: {1!r}'.format(msg.rstrip(), expr[:100])
+                msg = '{0} in: {1!r:.100}'.format(msg.rstrip(), expr)
             super(JSInterpreter.Exception, self).__init__(msg, *args, **kwargs)
 
     class JS_RegExp(object):
@@ -699,7 +699,7 @@ class JSInterpreter(object):
                 """ assert, but without risk of getting optimized out """
                 if not cndn:
                     memb = member
-                    raise self.Exception('{member} {msg}'.format(**locals()), expr=expr)
+                    raise self.Exception('{memb} {msg}'.format(**locals()), expr=expr)
 
             def eval_method():
                 if (variable, member) == ('console', 'debug'):