aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Osipov <osipov_d@list.ru>2018-04-19 04:50:25 +0500
committerŁukasz Langa <lukasz@langa.pl>2018-04-18 16:50:25 -0700
commite3a523a0fa16aec880880928303bfcbd1fb74bc2 (patch)
tree8325a7ac2e646ab9f21f530c3098c020db87e761 /Lib/lib2to3
parentbpo-33308: Fix a crash in the parser module when convert an ST object. (#6519) (diff)
downloadcpython-e3a523a0fa16aec880880928303bfcbd1fb74bc2.tar.gz
cpython-e3a523a0fa16aec880880928303bfcbd1fb74bc2.tar.bz2
cpython-e3a523a0fa16aec880880928303bfcbd1fb74bc2.zip
bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758)
Diffstat (limited to 'Lib/lib2to3')
-rw-r--r--Lib/lib2to3/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/lib2to3/main.py b/Lib/lib2to3/main.py
index 1a1df013ade..d6b708848ed 100644
--- a/Lib/lib2to3/main.py
+++ b/Lib/lib2to3/main.py
@@ -80,7 +80,7 @@ class StdoutRefactoringTool(refactor.MultiprocessRefactoringTool):
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)