mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 00:24:47 +04:00
resource_filename instead of trying to remember the right invocation to pkg_resources.
This commit is contained in:
parent
c7b605fee2
commit
8fee06b53e
3 changed files with 16 additions and 21 deletions
|
|
@ -5,6 +5,7 @@ import functools
|
|||
import hashlib
|
||||
import os
|
||||
import os.path
|
||||
import pkg_resources
|
||||
import shutil
|
||||
import sys
|
||||
import tarfile
|
||||
|
|
@ -89,3 +90,10 @@ def tmpdir():
|
|||
yield tempdir
|
||||
finally:
|
||||
shutil.rmtree(tempdir)
|
||||
|
||||
|
||||
def resource_filename(filename):
|
||||
return pkg_resources.resource_filename(
|
||||
'pre_commit',
|
||||
os.path.join('resources', filename),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue