Skip to content

Commit 585285c

Browse files
authored
Merge pull request #151 from equinor/bugfix-httpx-raise-for-status
Revert to code that works with httpx version 0.24.1
2 parents ff8d3a2 + fd935c9 commit 585285c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/sumo/wrapper/decorators.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
def raise_for_status(func):
66
def wrapper(*args, **kwargs):
7-
return func(*args, **kwargs).raise_for_status()
7+
# FIXME: in newer versions of httpx, raise_for_status() is chainable,
8+
# so we could simply write
9+
# return func(*args, **kwargs).raise_for_status()
10+
response = func(*args, **kwargs)
11+
response.raise_for_status()
12+
return response
813

914
return wrapper
1015

0 commit comments

Comments
 (0)