1. Yu-Jie Lin
  2. lnkckr

Commits

Yu-Jie Lin  committed 0f95873

fix error when max() on empty check list. Fixes Issue #3

  • Participants
  • Parent commits e5b18c3
  • Branches default

Comments (0)

Files changed (1)

File lnkckr/checkers/base.py

View file
  • Ignore whitespace
       nlinks = sum(1 for l in links)
       data2.append((status, nlinks))
 
-    l = max(self.num_len(item[1]) for item in data2)
+    l = max(self.num_len(item[1]) for item in data2) if data2 else 0
 
     for status, nlinks in data2:
       print('{} {:{l},d} links'.format(self.color_status(status), nlinks, l=l))