X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fswfinterp.py;h=e60505ace8b8451666f2aeebea3277bc58cb6297;hb=16e7711e22648027739096560914a976b8eea786;hp=6f3c3bf956bf3191c5206db53af3071994b95d59;hpb=fbf94a78158ea2ea70dcbc1599036a64bb3321c3;p=youtube-dl diff --git a/youtube_dl/swfinterp.py b/youtube_dl/swfinterp.py index 6f3c3bf95..e60505ace 100644 --- a/youtube_dl/swfinterp.py +++ b/youtube_dl/swfinterp.py @@ -4,8 +4,8 @@ import collections import io import zlib +from .compat import compat_str from .utils import ( - compat_str, ExtractorError, struct_unpack, ) @@ -170,6 +170,10 @@ class _Undefined(object): def __hash__(self): return 0 + def __str__(self): + return 'undefined' + __repr__ = __str__ + undefined = _Undefined() @@ -686,6 +690,7 @@ class SWFInterpreter(object): res = _builtin_classes[mname] else: # Assume unitialized + # TODO warn here res = undefined stack.append(res) elif opcode == 97: # setproperty @@ -822,4 +827,3 @@ class SWFInterpreter(object): avm_class.method_pyfunctions[func_name] = resfunc return resfunc -