]> git.madduck.net Git - etc/vim.git/commit

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Repair colorama wrapping on non-Windows platforms (#1670)
authorPete Grayson <github@jpgrayson.net>
Sun, 27 Sep 2020 21:41:11 +0000 (21:41 +0000)
committerGitHub <noreply@github.com>
Sun, 27 Sep 2020 21:41:11 +0000 (22:41 +0100)
commit4d71d74a442ccc6c309a0667147997c1eeb755fd
tree7530a8fbbb0e9d14eb5d293ad977bdde0ef6bcd6
parentbc138d12630ec38cb1b11b2fb2ca8762ac2ae7a4
Repair colorama wrapping on non-Windows platforms (#1670)

* Repair colorama wrapping on non-Windows platforms

The wrap_stream_for_windows() function calls
colorama.initialise.wrap_stream() function to apply colorama's magic to
wrapper to the output stream. Except this wrapper is only applied on
Windows platforms that need it, otherwise the original stream is
returned as-is.

The colorama wrapped stream lacks a detach() method, so a no-op lambda
was being assigned to the wrapped stream.

The problem is that the no-op lambda was being assigned unconditionally
whether or not colorama actually returns a wrapped stream, thus
replacing the original TextIOWrapper's detach() method. Replacing the
detach() method with a no-op lambda is the root cause of the problem
observed in #1664.

The solution is to only assign the no-op detach() method if the stream
lacks its own detach() method.

Repairs #1664
CHANGES.md
README.md
src/black/__init__.py