Skip to content

Commit 0edc85c

Browse files
author
Stephen Broberg
committed
Fix for Issue #48: Changed the black executable from a string to a list to allow 'python -m black' to be used instead of just 'black' for the executable name. This is because black as a standalong executable is not something that is typically supported on windows, but the python module invocation always works, and the zombie processes that were using up file handles for Issue 48 was due to the make-process function failing when it couldn't find a black executable. Changing blacken-executable to the list fixes this problem (assuming the black module is installed).
1 parent 526702e commit 0edc85c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

blacken.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
"Name of the executable to run."
4949
:type 'string)
5050

51+
(defcustom blacken-executable-list '(blacken-executable)
52+
"Command (with extra arguments) to invoke black"
53+
:type '(repeat string))
54+
5155
(defcustom blacken-line-length nil
5256
"Line length to enforce.
5357
@@ -92,7 +96,7 @@ output to OUTPUT-BUFFER. Saving process stderr to ERROR-BUFFER.
9296
Return black process the exit code."
9397
(with-current-buffer input-buffer
9498
(let ((process (make-process :name "blacken"
95-
:command `(,blacken-executable ,@(blacken-call-args))
99+
:command `(,@blacken-executable-list ,@(blacken-call-args))
96100
:buffer output-buffer
97101
:stderr error-buffer
98102
:connection-type 'pipe

0 commit comments

Comments
 (0)