diff --git a/src/python/bcc/__init__.py b/src/python/bcc/__init__.py index b42581303a57..3a7755aa49fc 100644 --- a/src/python/bcc/__init__.py +++ b/src/python/bcc/__init__.py @@ -446,7 +446,7 @@ def _check_path_symbol(cls, module, symname, addr): @staticmethod def find_library(libname): - return lib.bcc_procutils_which_so(libname) + return lib.bcc_procutils_which_so(libname.encode("ascii")).decode() def attach_uprobe(self, name="", sym="", addr=None, fn_name="", pid=-1, cpu=0, group_fd=-1): diff --git a/tools/argdist.py b/tools/argdist.py index 89f57c3a5402..9d7144250137 100755 --- a/tools/argdist.py +++ b/tools/argdist.py @@ -673,8 +673,8 @@ def run(self): except: if self.args.verbose: traceback.print_exc() - elif sys.exc_type is not SystemExit: - print(sys.exc_value) + elif sys.exc_info()[0] is not SystemExit: + print(sys.exc_info()[1]) self._close_probes() if __name__ == "__main__": diff --git a/tools/tplist.py b/tools/tplist.py index abb011d04d85..ff00744779c1 100755 --- a/tools/tplist.py +++ b/tools/tplist.py @@ -86,6 +86,6 @@ def print_usdt(pid, lib): else: print_tracepoints() except: - if sys.exc_type is not SystemExit: - print(sys.exc_value) + if sys.exc_info()[0] is not SystemExit: + print(sys.exc_info()[1])