--- a/test/test_autopep8.py	2022-07-01 16:53:14.197393816 +0300
+++ b/test/test_autopep8.py	2022-07-01 17:26:07.740358186 +0300
@@ -5729,7 +5729,11 @@
                 list(AUTOPEP8_CMD_TUPLE) + [filename, '--in-place'],
                 stderr=PIPE,
             )
-            _, err = p.communicate()
+            _, error = p.communicate()
+            if b'DeprecationWarning: lib2to3 package is deprecated' in error:
+                err = bytes()
+            else:
+                err = error
             self.assertEqual(err, b'')
             self.assertEqual(p.returncode, autopep8.EXIT_CODE_OK)
 
@@ -5741,7 +5745,11 @@
                 list(AUTOPEP8_CMD_TUPLE) + [filename, '--in-place'],
                 stderr=PIPE,
             )
-            _, err = p.communicate()
+            _, error = p.communicate()
+            if b'DeprecationWarning: lib2to3 package is deprecated' in error:
+                err = bytes()
+            else:
+                err = error
             self.assertEqual(err, b'')
             self.assertEqual(p.returncode, autopep8.EXIT_CODE_OK)
 
