def _flush(): for i in threads: http_queue.put(None) message = u'Waiting for %i network thread(s) to finish. Press ctrl-c to abort' % len(threads) if hasattr(sys, 'last_type'): # we quit because of an exception print sys.last_type pywikibot.critical(message) else: pywikibot.log(message) while any(t for t in threads if t.isAlive()): time.sleep(.1) pywikibot.log(u"All threads finished.")
def _flush(): for i in threads: http_queue.put(None) message = (u'Waiting for %i network thread(s) to finish. ' u'Press ctrl-c to abort' % len(threads)) if hasattr(sys, 'last_type'): # we quit because of an exception print(sys.last_type) pywikibot.critical(message) else: pywikibot.log(message) while any(t for t in threads if t.isAlive()): time.sleep(.1) pywikibot.log(u"All threads finished.")
def test_critical(self): pywikibot.critical('critical') self.assertEqual(newstdout.getvalue(), '') self.assertEqual(newstderr.getvalue(), 'CRITICAL: critical\n')
def test_critical(self): pywikibot.critical('critical') self.assertEqual(newstdout.getvalue(), '') self.assertEqual(newstderr.getvalue(), 'CRITICAL: critical\n')
def test_critical(self): pywikibot.critical("critical") self.assertEqual(newstdout.getvalue(), "") self.assertEqual(newstderr.getvalue(), "CRITICAL: critical\n")
def test_critical(self): pywikibot.critical("critical") self.assertEqual(newstdout.getvalue(), "") self.assertEqual(newstderr.getvalue(), "CRITICAL: critical\n")