Update src/PIL/ImageGrab.py

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Hankson Bradley 2023-04-19 15:58:01 +08:00 committed by GitHub
parent 5f62aaec5c
commit f672bf6cd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,7 @@ def grab(bbox=None, include_layered_windows=False, all_screens=False, xdisplay=N
elif shutil.which("gnome-screenshot") or shutil.which("scrot"):
fh, filepath = tempfile.mkstemp(".png")
os.close(fh)
if shutil.which("scrot"): # use scrot when have
if shutil.which("scrot"): # prefer scrot, as it is less intrusive
subprocess.call([shutil.which("scrot"), "-z", "--overwrite", filepath])
else:
subprocess.call([shutil.which("gnome-screenshot"), "-f", filepath])