bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) (#6528)

(cherry picked from commit e3a523a0fa16aec880880928303bfcbd1fb74bc2)

Co-authored-by: Denis Osipov <osipov_d@list.ru>
diff --git a/Lib/lib2to3/main.py b/Lib/lib2to3/main.py
index 1a1df01..d6b7088 100644
--- a/Lib/lib2to3/main.py
+++ b/Lib/lib2to3/main.py
@@ -80,7 +80,7 @@
             filename += self._append_suffix
         if orig_filename != filename:
             output_dir = os.path.dirname(filename)
-            if not os.path.isdir(output_dir):
+            if not os.path.isdir(output_dir) and output_dir:
                 os.makedirs(output_dir)
             self.log_message('Writing converted %s to %s.', orig_filename,
                              filename)