From 57f92d1e80cb3f864bb297e4ffdcfb4654179670 Mon Sep 17 00:00:00 2001 From: spike Date: Wed, 12 Oct 2022 13:51:18 +0200 Subject: [PATCH] should work with python3 --- howto/howto.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/howto/howto.py b/howto/howto.py index dd063da..c498ea0 100755 --- a/howto/howto.py +++ b/howto/howto.py @@ -18,7 +18,7 @@ class SOSearch(Site): super(SOSearch, self).__init__(self.domain, **kw) self.qs = self.search(order=DESC, sort='votes', tagged=self.tags, intitle=self.qs, filter='!-u2CTCMX') - if self.qs.total == 0: + if len(self.qs) == 0: raise NoResult def first_q(self): @@ -68,10 +68,10 @@ def main(args): so = SOSearch(args.query, args.tags) result = so.first_q().best_answer.code if result != None: - print result + print(result) else: print("Sorry I can't find your answer, try adding tags") - except NoResult, e: + except NoResult: print("Sorry I can't find your answer, try adding tags")