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

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:

Skip handling signals on event loops that don't support it (#156)
authorZsolt Dollenstein <zsol.zsol@gmail.com>
Sat, 21 Apr 2018 19:16:02 +0000 (20:16 +0100)
committerŁukasz Langa <lukasz@langa.pl>
Sat, 21 Apr 2018 19:16:02 +0000 (12:16 -0700)
black.py

index 49a5729f5881dcde54ab2fcb4fd4da2f7b7055e6..9dd3536ab8f0fc3c282310b9b8adeb437a750465 100644 (file)
--- a/black.py
+++ b/black.py
@@ -293,8 +293,12 @@ async def schedule_formatting(
             for src in sources
         }
         _task_values = list(tasks.values())
-        loop.add_signal_handler(signal.SIGINT, cancel, _task_values)
-        loop.add_signal_handler(signal.SIGTERM, cancel, _task_values)
+        try:
+            loop.add_signal_handler(signal.SIGINT, cancel, _task_values)
+            loop.add_signal_handler(signal.SIGTERM, cancel, _task_values)
+        except NotImplementedError:
+            # There are no good alternatives for these on Windows
+            pass
         await asyncio.wait(_task_values)
         for src, task in tasks.items():
             if not task.done():