Skip to content

Commit 6564099

Browse files
authored
Use importlib-resources package because pkg_resources is deprecated in Python 3.12 and it is backwards compatible. (#261)
1 parent 13f91f3 commit 6564099

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

happybase/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
HBase.
44
"""
55

6-
import pkg_resources as _pkg_resources
6+
import importlib_resources as _importlib_resources
77
import thriftpy2 as _thriftpy
8+
89
_thriftpy.load(
9-
_pkg_resources.resource_filename('happybase', 'Hbase.thrift'),
10+
str(_importlib_resources.files('happybase') / 'Hbase.thrift'),
1011
'Hbase_thrift')
1112

1213
from ._version import __version__ # noqa

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
six
22
thriftpy2>=0.4
3+
importlib-resources

0 commit comments

Comments
 (0)