mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 22:34:52 +00:00
Use uvloop, if available
This commit is contained in:
parent
c9cd79cb05
commit
d06097c68a
1 changed files with 8 additions and 0 deletions
|
|
@ -16,6 +16,7 @@
|
||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import asyncio
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
__copyright__ = "Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>".replace(
|
__copyright__ = "Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>".replace(
|
||||||
|
|
@ -41,3 +42,10 @@ from .client import (
|
||||||
MessageHandler, DeletedMessagesHandler, CallbackQueryHandler,
|
MessageHandler, DeletedMessagesHandler, CallbackQueryHandler,
|
||||||
RawUpdateHandler, DisconnectHandler, Filters
|
RawUpdateHandler, DisconnectHandler, Filters
|
||||||
)
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
import uvloop
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue