bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) · python/cpython@e3a523a

Original file line numberDiff line numberDiff line change

@@ -80,7 +80,7 @@ def write_file(self, new_text, filename, old_text, encoding):

8080

filename += self._append_suffix

8181

if orig_filename != filename:

8282

output_dir = os.path.dirname(filename)

83-

if not os.path.isdir(output_dir):

83+

if not os.path.isdir(output_dir) and output_dir:

8484

os.makedirs(output_dir)

8585

self.log_message('Writing converted %s to %s.', orig_filename,

8686

filename)