Skip to content

Commit 06b7acd

Browse files
CopilotMishkatIT
andcommitted
Use specific exception types and remove unnecessary debug output
Co-authored-by: MishkatIT <125080003+MishkatIT@users.noreply.github.com>
1 parent 7e066aa commit 06b7acd

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎update_stats.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def _load_last_known_counts(self):
3232
except FileNotFoundError:
3333
# File doesn't exist yet, will be created on first save
3434
pass
35-
except Exception as e:
35+
except (json.JSONDecodeError, IOError) as e:
3636
print(f"Warning: Could not load last known counts: {e}")
3737
return {'counts': {}, 'dates': {}}
3838

@@ -41,7 +41,7 @@ def _save_last_known_counts(self):
4141
try:
4242
with open(self.LAST_KNOWN_FILE, 'w') as f:
4343
json.dump(self.last_known_counts, f, indent=2)
44-
except Exception as e:
44+
except (IOError, OSError) as e:
4545
print(f"Warning: Could not save last known counts: {e}")
4646

4747
def _update_last_known(self, platform, count):
@@ -209,7 +209,6 @@ def get_codechef(self):
209209
count = int(match.group(1))
210210
# Sanity check - CodeChef count should be reasonable
211211
if 0 < count < MAX_REASONABLE_COUNT:
212-
print(f" Found using pattern: {pattern[:50]}...")
213212
return count
214213

215214
# If no pattern matched, save HTML for debugging (in verbose mode)

0 commit comments

Comments
 (0)