Skip to content

Commit 95750d0

Browse files
committed
fix pkg_resources deprecation
1 parent 1480be2 commit 95750d0

File tree

2 files changed

+5
-44
lines changed

2 files changed

+5
-44
lines changed

.travis.yml

-40
This file was deleted.

sflock/config.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010

1111
def iter_passwords():
12-
import pkg_resources
12+
from importlib.resources import as_file
13+
from pathlib import Path
1314

14-
filepath = pkg_resources.resource_filename("sflock", "data/password.txt")
15-
for line in open(filepath, "rb"):
16-
yield line.strip()
15+
with as_file(Path("sflock/data/password.txt")) as passwd_file:
16+
for line in passwd_file.read_text().splitlines():
17+
yield line.strip()

0 commit comments

Comments
 (0)