1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
From 6a672f621d1bf39970df3b30692e035928aafbe1 Mon Sep 17 00:00:00 2001
From: Doctor <thirvondukr@gmail.com>
Date: Wed, 11 Sep 2024 15:10:43 +0300
Subject: [PATCH] refactor: remove deprecated pkg_resources usage
This patch is taken from the fork recommended in #1099184
--- a/passlib/pwd.py
+++ b/passlib/pwd.py
@@ -13,7 +13,7 @@
from collections import MutableMapping
from math import ceil, log as logf
import logging; log = logging.getLogger(__name__)
-import pkg_resources
+from importlib import resources
import os
# site
# pkg
@@ -122,7 +122,7 @@
if not sep:
raise ValueError("asset path must be absolute file path "
"or use 'pkg.name:sub/path' format: %r" % (path,))
- return pkg_resources.resource_stream(package, subpath)
+ return resources.files(package).joinpath(subpath).open("rb")
#: type aliases
|