Skip to content

Commit 36ddf16

Browse files
authored
Merge pull request #1414 from rayrapetyan/freebsd_uvloop
Use uvloop in FreeBSD
2 parents bad0c8e + 7337d80 commit 36ddf16

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"web3==4.4.1",
4747
"lahja==0.9.0",
4848
"termcolor>=1.1.0,<2.0.0",
49-
"uvloop==0.11.2;platform_system=='Linux' or platform_system=='Darwin'",
49+
"uvloop==0.11.2;platform_system=='Linux' or platform_system=='Darwin' or platform_system=='FreeBSD'",
5050
"websockets==5.0.1",
5151
],
5252
'test': [

trinity/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
# This is to ensure we call setup_trace_logging() before anything else.
1414
import eth as _eth_module # noqa: F401
1515

16-
if sys.platform in {'darwin', 'linux'}:
16+
17+
def is_uvloop_supported() -> bool:
18+
return sys.platform in {'darwin', 'linux'} or sys.platform.startswith('freebsd')
19+
20+
21+
if is_uvloop_supported():
1722
# Set `uvloop` as the default event loop
1823
import asyncio # noqa: E402
1924
import uvloop # noqa: E402

0 commit comments

Comments
 (0)