Skip to content

Commit 93a36b9

Browse files
Lint fix
1 parent 53d464a commit 93a36b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

percy/snapshot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def log(message, lvl = 'info'):
3333
except Exception as e:
3434
if PERCY_DEBUG: print(f'Sending log to CLI Failed {e}')
3535
finally:
36-
# Do not log on console if percy_debug is not true
37-
if lvl == 'debug' and not PERCY_DEBUG: return
38-
print(message)
36+
# Only log if lvl is 'debug' and PERCY_DEBUG is True
37+
if lvl != 'debug' or PERCY_DEBUG:
38+
print(message)
3939

4040
# Check if Percy is enabled, caching the result so it is only checked once
4141
@lru_cache(maxsize=None)
@@ -101,8 +101,8 @@ def change_window_dimension_and_wait(driver, width, height, resizeCount):
101101
'width': width, 'deviceScaleFactor': 1, 'mobile': False })
102102
else:
103103
driver.set_window_size(width, height)
104-
except:
105-
log(f'Resizing using cdp failed falling back driver for width {width}', 'debug')
104+
except Exception as e:
105+
log(f'Resizing using cdp failed falling back driver for width {width} {e}', 'debug')
106106
driver.set_window_size(width, height)
107107

108108
try:

0 commit comments

Comments
 (0)