Skip to content

Commit 5c63c45

Browse files
authored
Merge pull request #140 from maxmind/greg/run-black
Run new black version against repo
2 parents cf2d16f + e84af39 commit 5c63c45

4 files changed

Lines changed: 16 additions & 12 deletions

File tree

geoip2/webservice.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,17 @@ def _exception_for_4xx_status(
142142
uri,
143143
body,
144144
)
145-
else:
146-
if "code" in decoded_body and "error" in decoded_body:
147-
return self._exception_for_web_service_error(
148-
decoded_body.get("error"), decoded_body.get("code"), status, uri
149-
)
150-
return HTTPError(
151-
"Response contains JSON but it does not specify code or error keys",
152-
status,
153-
uri,
154-
body,
145+
146+
if "code" in decoded_body and "error" in decoded_body:
147+
return self._exception_for_web_service_error(
148+
decoded_body.get("error"), decoded_body.get("code"), status, uri
155149
)
150+
return HTTPError(
151+
"Response contains JSON but it does not specify code or error keys",
152+
status,
153+
uri,
154+
body,
155+
)
156156

157157
@staticmethod
158158
def _exception_for_web_service_error(

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# We should probably migrate most of setup.cfg here
2+
3+
[tool.black]
4+
# src is showing up in our GitHub linting builds. It seems to
5+
# contain deps.
6+
extend-exclude = '^/src/'

tests/models_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ def test_unknown_keys(self) -> None:
385385

386386

387387
class TestNames(unittest.TestCase):
388-
389388
raw: Dict = {
390389
"continent": {
391390
"code": "NA",

tests/webservice_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ def test_300_error(self):
209209
with self.assertRaisesRegex(
210210
HTTPError, r"Received a very surprising HTTP status \(300\) for"
211211
):
212-
213212
self.run_client(self.client.country("1.2.3.11"))
214213

215214
@httprettified

0 commit comments

Comments
 (0)