Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
systemsmanagement:saltstack:bundle:testing:SLE11
saltbundlepy-passlib
no-pkg_resources.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File no-pkg_resources.patch of Package saltbundlepy-passlib
Index: passlib-1.7.4/passlib/pwd.py =================================================================== --- passlib-1.7.4.orig/passlib/pwd.py +++ passlib-1.7.4/passlib/pwd.py @@ -13,8 +13,8 @@ except ImportError: from collections import MutableMapping from math import ceil, log as logf import logging; log = logging.getLogger(__name__) -import pkg_resources import os +import sys # site # pkg from passlib import exc @@ -122,7 +122,14 @@ def _open_asset_path(path, encoding=None 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) + if sys.version_info >= (3, 9): + # We can use the new and shiny importlib.resources + import importlib.resources + return importlib.resources.files(package).joinpath(subpath).open('rb') + else: + # Fallback to pkg_resources + import pkg_resources + return pkg_resources.resource_stream(package, subpath) #: type aliases
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor