Skip to content

Commit 67067d8

Browse files
miss-islingtondenis-osipov
authored andcommitted
bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) (#6528)
(cherry picked from commit e3a523a) Co-authored-by: Denis Osipov <osipov_d@list.ru>
1 parent b88f737 commit 67067d8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/lib2to3/main.py

Lines changed: 1 addition & 1 deletion
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)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix 2to3 for using with --add-suffix option but without --output-dir
2+
option for relative path to files in current directory.

0 commit comments

Comments
 (0)