diff options
author | Chris Lamb <lamby@debian.org> | 2016-01-11 12:59:31 +0000 |
---|---|---|
committer | Chris Lamb <lamby@debian.org> | 2016-01-11 12:59:31 +0000 |
commit | a5e050949be4dcd842d8da49f3832e3a5a142ed8 (patch) | |
tree | 86e87b35febd54728a3f652b963c587586864556 /bin/tracker_data.py | |
parent | 2c989c87eb1855667bf1c293660365434b60f9ca (diff) |
No need for explicit conditional; raise_for_status does this by design
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@38839 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/tracker_data.py')
-rw-r--r-- | bin/tracker_data.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/bin/tracker_data.py b/bin/tracker_data.py index f05dd256a3..28f8a7f17a 100644 --- a/bin/tracker_data.py +++ b/bin/tracker_data.py @@ -93,13 +93,11 @@ class TrackerData(object): 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: |