Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ coverage==5.3.1
ecdsa==0.18.0
xlrd==1.2.0
cryptography==44.0.2
importlib-resources; python_version < "3.9"
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
try:
from importlib import resources as importlib_resources
except ImportError:
import importlib_resources
from socsec import __version__
import setuptools

Expand Down
12 changes: 11 additions & 1 deletion socsec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@
from bitarray import bitarray
import os
from ecdsa.keys import VerifyingKey
from pkg_resources import resource_filename as pkgdata
try:
from importlib import resources as importlib_resources
except ImportError:
import importlib_resources

def pkgdata(package, resource):
try:
return str(importlib_resources.files(package).joinpath(resource))
except AttributeError:
with importlib_resources.path(package, resource) as p:
return str(p)
import struct
from Crypto.PublicKey import RSA
import binascii
Expand Down