Skip to content

bpo-31583: Fix 2to3 for using with --add-suffix option #3758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/lib2to3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def write_file(self, new_text, filename, old_text, encoding):
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)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix 2to3 for using with --add-suffix option but without --output-dir
option for relative path to files in current directory.