Get rig of EnvironmentError (#16705)
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 93e6cd9..c0ae8b1 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -2022,7 +2022,7 @@
         try:
             self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
                                  set_attrs=set_attrs)
-        except EnvironmentError as e:
+        except OSError as e:
             if self.errorlevel > 0:
                 raise
             else:
@@ -2212,7 +2212,7 @@
                     os.lchown(targetpath, u, g)
                 else:
                     os.chown(targetpath, u, g)
-            except EnvironmentError as e:
+            except OSError as e:
                 raise ExtractError("could not change owner")
 
     def chmod(self, tarinfo, targetpath):
@@ -2221,7 +2221,7 @@
         if hasattr(os, 'chmod'):
             try:
                 os.chmod(targetpath, tarinfo.mode)
-            except EnvironmentError as e:
+            except OSError as e:
                 raise ExtractError("could not change mode")
 
     def utime(self, tarinfo, targetpath):
@@ -2231,7 +2231,7 @@
             return
         try:
             os.utime(targetpath, (tarinfo.mtime, tarinfo.mtime))
-        except EnvironmentError as e:
+        except OSError as e:
             raise ExtractError("could not change modification time")
 
     #--------------------------------------------------------------------------