Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1957e7b

Browse files
miss-islingtondenis-osipov
authored andcommittedApr 19, 2018
bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) (GH-6529)
(cherry picked from commit e3a523a) Co-authored-by: Denis Osipov <osipov_d@list.ru>
1 parent e735634 commit 1957e7b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎Lib/lib2to3/main.py

+1-1
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)
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)
Please sign in to comment.