Skip to content

Commit

Permalink
[package] use google-crc32c instead of crc32c (fixes: aiortc#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaine committed Jul 11, 2021
1 parent dc15fe2 commit 1a19238
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"aioice>=0.7.5,<0.8.0",
"av>=8.0.0,<9.0.0",
"cffi>=1.0.0",
"crc32c>=2.1",
"cryptography>=2.2",
'dataclasses; python_version < "3.7"',
"google-crc32c>=1.1",
"pyee>=6.0.0",
"pylibsrtp>=0.5.6",
]
Expand Down
7 changes: 6 additions & 1 deletion src/aiortc/rtcsctptransport.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
no_type_check,
)

from crc32c import crc32c
# The `crc32c` package offers better performance but uses an LGPL license,
# so we use `google-crc32c` by default.
try:
from crc32c import crc32c
except ImportError:
from google_crc32c import value as crc32c
from pyee import AsyncIOEventEmitter

from .exceptions import InvalidStateError
Expand Down
1 change: 1 addition & 0 deletions stubs/google_crc32c.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
def value(data: bytes) -> int: ...

0 comments on commit 1a19238

Please sign in to comment.