mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-31 15:12:20 +00:00 
			
		
		
		
	Fix dirty_unzip rule on non-zip files
This commit is contained in:
		| @@ -19,7 +19,6 @@ def _is_tar_extract(cmd): | |||||||
|  |  | ||||||
|  |  | ||||||
| def _tar_file(cmd): | def _tar_file(cmd): | ||||||
|  |  | ||||||
|     for c in cmd: |     for c in cmd: | ||||||
|         for ext in tar_extensions: |         for ext in tar_extensions: | ||||||
|             if c.endswith(ext): |             if c.endswith(ext): | ||||||
|   | |||||||
| @@ -5,8 +5,11 @@ from thefuck.shells import quote | |||||||
|  |  | ||||||
|  |  | ||||||
| def _is_bad_zip(file): | def _is_bad_zip(file): | ||||||
|  |     try: | ||||||
|         with zipfile.ZipFile(file, 'r') as archive: |         with zipfile.ZipFile(file, 'r') as archive: | ||||||
|             return len(archive.namelist()) > 1 |             return len(archive.namelist()) > 1 | ||||||
|  |     except: | ||||||
|  |         return False | ||||||
|  |  | ||||||
|  |  | ||||||
| def _zip_file(command): | def _zip_file(command): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user