Skip to content

Commit b6b2318

Browse files
fix: change data.get('data', None)
1 parent 995679d commit b6b2318

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

percy/snapshot.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ def percy_snapshot(driver, name, **kwargs):
8686
data = response.json()
8787

8888
if not data['success']: raise Exception(data['error'])
89-
if not data["data"]: return None
90-
return data["data"]
89+
return data.get("data", None)
9190
except Exception as e:
9291
print(f'{LABEL} Could not take DOM snapshot "{name}"')
9392
print(f'{LABEL} {e}')
@@ -144,8 +143,7 @@ def percy_automate_screenshot(driver, name, options = None, **kwargs):
144143
data = response.json()
145144

146145
if not data['success']: raise Exception(data['error'])
147-
if not data['data']: return None
148-
return data['data']
146+
return data.get("data", None)
149147
except Exception as e:
150148
print(f'{LABEL} Could not take Screenshot "{name}"')
151149
print(f'{LABEL} {e}')

0 commit comments

Comments
 (0)