59821a5dc11de9f0ceb3c42c3698d354bc04df6f,src/python/pants/backend/core/wrapped_globs.py,FilesetRelPathWrapper,__call__,#FilesetRelPathWrapper#,19
Before Change
if(self._is_glob_dir_outside_root(glob, root)):
raise ValueError("Invalid glob %s, points outside BUILD file root dir %s" % (glob, root))
return self.wrapped_fn(root=root, *args, **kwargs)
def _is_glob_dir_outside_root(self, glob, root):
// The assumption is that a correct glob starts with the root,
// even after normalizing.
After Change
def __call__(self, *args, **kwargs):
root = os.path.join(get_buildroot(), self.rel_path)
excludes = kwargs.pop("exclude", [])
if isinstance(excludes, string_types):
raise ValueError("Expected exclude parameter to be a list of globs, lists, or strings")
for i, exclude in enumerate(excludes):
if isinstance(exclude, string_types):
// You can"t subtract raw strings from globs
excludes[i] = [exclude]
for glob in args:
if(self._is_glob_dir_outside_root(glob, root)):
raise ValueError("Invalid glob %s, points outside BUILD file root dir %s" % (glob, root))
result = self.wrapped_fn(root=root, *args, **kwargs)
for exclude in excludes:
result -= exclude
return result
def _is_glob_dir_outside_root(self, glob, root):
// The assumption is that a correct glob starts with the root,
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances Project Name: pantsbuild/pants
Commit Name: 59821a5dc11de9f0ceb3c42c3698d354bc04df6f
Time: 2015-02-17
Author: dturner@twitter.com
File Name: src/python/pants/backend/core/wrapped_globs.py
Class Name: FilesetRelPathWrapper
Method Name: __call__
Project Name: open-mmlab/mmdetection
Commit Name: 62255259513e6d203d120b90cd847fa09335b6e0
Time: 2019-01-14
Author: chenkaidev@gmail.com
File Name: mmdet/models/builder.py
Class Name:
Method Name: _build_module
Project Name: scipy/scipy
Commit Name: e6666a3fd4a05f439bb8555c926c513bc1b29639
Time: 2013-10-11
Author: pav@iki.fi
File Name: scipy/sparse/base.py
Class Name: spmatrix
Method Name: __numpy_ufunc__