mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Rearrange error handling
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
1522b3fb84
commit
6998f34768
|
@ -171,7 +171,9 @@ def grabclipboard():
|
|||
err = p.stderr
|
||||
if any(e in err for e in allowed_errors):
|
||||
return None
|
||||
msg = f"{args[0]} error: {err.strip().decode() if err else 'Unknown error'}"
|
||||
msg = f"{args[0]} error"
|
||||
if err:
|
||||
msg += f": {err.strip().decode()}"
|
||||
raise ChildProcessError(msg)
|
||||
|
||||
data = io.BytesIO(p.stdout)
|
||||
|
|
Loading…
Reference in New Issue
Block a user