From: Chuck Wooters Date: Mon, 29 Oct 2018 10:10:32 +0000 (-0700) Subject: patch main to ensure click_patch() gets called (#572) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/5c2dd96a69a935cf45acbdf2ffabbd39b27d38fa?ds=sidebyside;hp=99c97c3d7fa8532faf11f818bf1fcf08e991e62c patch main to ensure click_patch() gets called (#572) --- diff --git a/README.md b/README.md index afb160e..a255022 100644 --- a/README.md +++ b/README.md @@ -1351,3 +1351,4 @@ Multiple contributions by: * [Stavros Korokithakis](mailto:hi@stavros.io) * [Sunil Kapil](mailto:snlkapil@gmail.com) * [Vishwas B Sharma](mailto:sharma.vishwas88@gmail.com) +* [Chuck Wooters](mailto:chuck.wooters@microsoft.com) diff --git a/black.py b/black.py index d060820..4d85865 100644 --- a/black.py +++ b/black.py @@ -3662,6 +3662,10 @@ def patch_click() -> None: module._verify_python3_env = lambda: None -if __name__ == "__main__": +def patched_main() -> None: patch_click() main() + + +if __name__ == "__main__": + patched_main() diff --git a/blackd.py b/blackd.py index 50614d0..e1006a1 100644 --- a/blackd.py +++ b/blackd.py @@ -108,6 +108,10 @@ async def handle(request: web.Request, executor: Executor) -> web.Response: return web.Response(status=500, text=str(e)) -if __name__ == "__main__": +def patched_main() -> None: black.patch_click() main() + + +if __name__ == "__main__": + patched_main() diff --git a/setup.py b/setup.py index 87583ca..096be9e 100644 --- a/setup.py +++ b/setup.py @@ -57,5 +57,10 @@ setup( "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Quality Assurance", ], - entry_points={"console_scripts": ["black=black:main", "blackd=blackd:main [d]"]}, + entry_points={ + "console_scripts": [ + "black=black:patched_main", + "blackd=blackd:patched_main [d]", + ] + }, )