From a6e50572e0f695718ce621bdc8a18a6b739709fa Mon Sep 17 00:00:00 2001 From: Yorwba Date: Sun, 8 Apr 2018 22:37:12 +0800 Subject: [PATCH] Fix check for bound methods on falsy objects. --- byterun/pyvm2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/byterun/pyvm2.py b/byterun/pyvm2.py index 394e2e0b..2855df88 100644 --- a/byterun/pyvm2.py +++ b/byterun/pyvm2.py @@ -950,7 +950,7 @@ def call_function(self, arg, args, kwargs): frame = self.frame if hasattr(func, 'im_func'): # Methods get self as an implicit first parameter. - if func.im_self: + if func.im_self is not None: posargs.insert(0, func.im_self) # The first parameter must be the correct type. if not isinstance(posargs[0], func.im_class):