Black as a library import should check for running event loop before installing #2302
Labels
S: accepted
The changes in this design / enhancement issue have been accepted and can be implemented
T: enhancement
New feature or request
black/src/black/__init__.py
Lines 57 to 63 in f2a3fee
See comments I left here 754eecf#r51686621
what is the issue?
We are using the black library in a system that already had an eventloop set. Importing black the library now clears the event loop settings we had. Impact to us is that we cannot use this latest version of black.
Suggestion
Black the library should not assume that it can create its own event loop -- instead it should check to see if a running event loop exists before calling
uvloop.install()
.Actually, I'd go further to ask why the library should be thinking about controlling an eventloop in the first place? Much like configuring loggers should not be set in libraries, event loops should not be set in libraries either?
The text was updated successfully, but these errors were encountered: