Skip to content

Commit e68bcc5

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 e68bcc5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

blacken.el

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
"Reformat Python code with \"black\"."
4545
:group 'python)
4646

47-
(defcustom blacken-executable "black"
47+
(defcustom blacken-executable '("black")
4848
"Name of the executable to run."
49-
:type 'string)
49+
:type '(repeat string))
5050

5151
(defcustom blacken-line-length nil
5252
"Line length to enforce.
@@ -92,7 +92,7 @@ output to OUTPUT-BUFFER. Saving process stderr to ERROR-BUFFER.
9292
Return black process the exit code."
9393
(with-current-buffer input-buffer
9494
(let ((process (make-process :name "blacken"
95-
:command `(,blacken-executable ,@(blacken-call-args))
95+
:command `(,@blacken-executable ,@(blacken-call-args))
9696
:buffer output-buffer
9797
:stderr error-buffer
9898
:connection-type 'pipe

0 commit comments

Comments
 (0)