Author: zturner Date: Mon Oct 26 13:48:24 2015 New Revision: 251329 URL: http://llvm.org/viewvc/llvm-project?rev=251329&view=rev Log: Python 3: Convert uses of `callable(x)` to `six.callable(x)`.
Modified: lldb/trunk/test/dotest.py lldb/trunk/test/lldbcurses.py lldb/trunk/test/lldbtest.py lldb/trunk/test/lldbutil.py Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=251329&r1=251328&r2=251329&view=diff ============================================================================== --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Mon Oct 26 13:48:24 2015 @@ -860,12 +860,12 @@ def parseOptionsAndInitTestdirs(): #print("config:", config) if "pre_flight" in config: pre_flight = config["pre_flight"] - if not callable(pre_flight): + if not six.callable(pre_flight): print("fatal error: pre_flight is not callable, exiting.") sys.exit(1) if "post_flight" in config: post_flight = config["post_flight"] - if not callable(post_flight): + if not six.callable(post_flight): print("fatal error: post_flight is not callable, exiting.") sys.exit(1) if "lldbtest_remote_sandbox" in config: Modified: lldb/trunk/test/lldbcurses.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbcurses.py?rev=251329&r1=251328&r2=251329&view=diff ============================================================================== --- lldb/trunk/test/lldbcurses.py (original) +++ lldb/trunk/test/lldbcurses.py Mon Oct 26 13:48:24 2015 @@ -176,7 +176,7 @@ class Window(object): def set_first_responder(self, window): if window.can_become_first_responder: - if callable(getattr(window, "hidden", None)) and window.hidden(): + if six.callable(getattr(window, "hidden", None)) and window.hidden(): return False if not window in self.children: self.add_child(window) @@ -386,7 +386,7 @@ class Window(object): return True # Check if the window delegate wants to handle this key press if self.delegate: - if callable(getattr(self.delegate, "handle_key", None)): + if six.callable(getattr(self.delegate, "handle_key", None)): if self.delegate.handle_key(self, key): return True if self.delegate(self, key): Modified: lldb/trunk/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=251329&r1=251328&r2=251329&view=diff ============================================================================== --- lldb/trunk/test/lldbtest.py (original) +++ lldb/trunk/test/lldbtest.py Mon Oct 26 13:48:24 2015 @@ -54,6 +54,8 @@ import test_categories from six import add_metaclass from six import StringIO as SixStringIO from six.moves.urllib import parse as urlparse +import six +import collections # dosep.py starts lots and lots of dotest instances # This option helps you find if two (or more) dotest instances are using the same @@ -622,7 +624,7 @@ def expectedFailure(expected_fn, bugnumb return wrapper # if bugnumber is not-callable(incluing None), that means decorator function is called with optional arguments # return decorator in this case, so it will be used to decorating original method - if callable(bugnumber): + if six.callable(bugnumber): return expectedFailure_impl(bugnumber) else: return expectedFailure_impl @@ -762,7 +764,7 @@ def expectedFlakey(expected_fn, bugnumbe return wrapper # if bugnumber is not-callable(incluing None), that means decorator function is called with optional arguments # return decorator in this case, so it will be used to decorating original method - if callable(bugnumber): + if six.callable(bugnumber): return expectedFailure_impl(bugnumber) else: return expectedFailure_impl @@ -1088,7 +1090,7 @@ def skipTestIfFn(expected_fn, bugnumber= else: func(*args, **kwargs) return wrapper - if callable(bugnumber): + if six.callable(bugnumber): return skipTestIfFn_impl(bugnumber) else: return skipTestIfFn_impl @@ -1606,7 +1608,7 @@ class Base(unittest2.TestCase): Hooks are executed in a first come first serve manner. """ - if callable(hook): + if six.callable(hook): with recording(self, traceAlways) as sbuf: print("Adding tearDown hook:", getsource_if_available(hook), file=sbuf) self.hooks.append(hook) Modified: lldb/trunk/test/lldbutil.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=251329&r1=251328&r2=251329&view=diff ============================================================================== --- lldb/trunk/test/lldbutil.py (original) +++ lldb/trunk/test/lldbutil.py Mon Oct 26 13:48:24 2015 @@ -13,6 +13,8 @@ import os, sys import re from six import StringIO as SixStringIO +import six +import collections # =================================================== # Utilities for locating/checking executable programs @@ -979,7 +981,7 @@ class PrintableRegex(object): return "re.compile(%s) -> %s" % (self.text, self.regex) def skip_if_callable(test, callable, reason): - if callable(test) == True: + if six.callable(test): test.skipTest(reason) return True return False _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits