We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3cb4bb commit ab3d0c0Copy full SHA for ab3d0c0
src/PIL/ImageGrab.py
@@ -141,8 +141,11 @@ def grabclipboard():
141
msg = "wl-paste or xclip is required for ImageGrab.grabclipboard() on Linux"
142
raise NotImplementedError(msg)
143
fh, filepath = tempfile.mkstemp()
144
- subprocess.call(args, stdout=fh)
+ err = subprocess.run(args, stdout=fh, stderr=subprocess.PIPE).stderr
145
os.close(fh)
146
+ if err:
147
+ msg = f"{args[0]} error: {err.strip().decode()}"
148
+ raise ChildProcessError(msg)
149
im = Image.open(filepath)
150
im.load()
151
os.unlink(filepath)
0 commit comments