mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-30 23:47:27 +03:00 
			
		
		
		
	Only check for gnome-screenshot on Linux
Co-authored-by: Ondrej Baranovič <3819630+nulano@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									bb18abc603
								
							
						
					
					
						commit
						3ec03c6720
					
				|  | @ -71,7 +71,11 @@ def grab(bbox=None, include_layered_windows=False, all_screens=False, xdisplay=N | |||
|             im = im.crop(bbox) | ||||
|         return im | ||||
|     except OSError: | ||||
|         if xdisplay is None and shutil.which("gnome-screenshot"): | ||||
|         if ( | ||||
|             xdisplay is None | ||||
|             and sys.platform not in ("darwin", "win32") | ||||
|             and shutil.which("gnome-screenshot") | ||||
|         ): | ||||
|             fh, filepath = tempfile.mkstemp(".png") | ||||
|             os.close(fh) | ||||
|             subprocess.call(["gnome-screenshot", "-f", filepath]) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user