From 1dba7379b08b359810aeb02ff32ead178799ed4c Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 27 May 2015 15:00:53 -0700 Subject: [PATCH] Allow python --replace on files in the current directory Fixes #686 --- python/jsbeautifier/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/jsbeautifier/__init__.py b/python/jsbeautifier/__init__.py index 48981a6d7..faacb489b 100644 --- a/python/jsbeautifier/__init__.py +++ b/python/jsbeautifier/__init__.py @@ -1168,7 +1168,8 @@ def handle_eof(self, current_token): def mkdir_p(path): try: - os.makedirs(path) + if path: + os.makedirs(path) except OSError as exc: # Python >2.5 if exc.errno == errno.EEXIST and os.path.isdir(path): pass