Permalink
Browse files

assert that relative_filename is absolute

  • Loading branch information...
robnagler committed Oct 8, 2018
1 parent 541b12b commit 789b4f4f26149ec30a4e077268ccb80c2be9257d
Showing with 2 additions and 0 deletions.
  1. +2 −0 pykern/pkresource.py
View
@@ -29,6 +29,8 @@ def filename(relative_filename, caller_context=None):
"""
pkg = pkinspect.root_package(
caller_context if caller_context else pkinspect.caller_module())
assert not os.path.isabs(relative_filename), \
'must not be an absolute file name={}'.format(relative_filename)
fn = os.path.join(pksetup.PACKAGE_DATA, relative_filename)
res = pkg_resources.resource_filename(pkg, fn)
if not os.path.exists(res):

0 comments on commit 789b4f4

Please sign in to comment.