[Secure-testing-commits] r38839 - bin
Chris Lamb
lamby at moszumanska.debian.org
Mon Jan 11 12:59:31 UTC 2016
Author: lamby
Date: 2016-01-11 12:59:31 +0000 (Mon, 11 Jan 2016)
New Revision: 38839
Modified:
bin/tracker_data.py
Log:
No need for explicit conditional; raise_for_status does this by design
Modified: bin/tracker_data.py
===================================================================
--- bin/tracker_data.py 2016-01-11 09:57:59 UTC (rev 38838)
+++ bin/tracker_data.py 2016-01-11 12:59:31 UTC (rev 38839)
@@ -93,13 +93,11 @@
print("Updating {} from {} ...".format(self.CACHED_DATA_PATH,
self.DATA_URL))
response = requests.get(self.DATA_URL, allow_redirects=True)
- if response.status_code == 200:
- with open(self.cached_data_path, 'w') as cache_file:
- cache_file.write(response.text)
- with open(self.cached_revision_path, 'w') as rev_file:
- rev_file.write('{}'.format(self.latest_revision))
- else:
- response.raise_for_status()
+ response.raise_for_status()
+ with open(self.cached_data_path, 'w') as cache_file:
+ cache_file.write(response.text)
+ with open(self.cached_revision_path, 'w') as rev_file:
+ rev_file.write('{}'.format(self.latest_revision))
def load(self):
with open(self.cached_data_path, 'r') as f:
More information about the Secure-testing-commits
mailing list