Conditions | 1 |
Total Lines | 13 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import atexit |
||
35 | def resource_string(package: str, resource: str) -> bytes: |
||
36 | """ |
||
37 | Reimplementation of the function with the same name from pkg_resources |
||
38 | |||
39 | Using importlib for better performance |
||
40 | |||
41 | package : str |
||
42 | The package from where to start looking for resource (often __name__) |
||
43 | resource : str |
||
44 | The resource to look up |
||
45 | """ |
||
46 | parent_package = package.rsplit('.',1)[0] |
||
47 | return read_binary(parent_package, resource) |
||
48 | |||
51 |