This repository was archived by the owner on Nov 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,7 +124,12 @@ def load_hook_files(pathname):
124124
125125 fsglob = glob .iglob (pathname )
126126 for path in fsglob :
127- module = imp .load_source (os .path .basename (path ), path )
127+ real_path = os .path .realpath (path )
128+ # Append hooks file directory to the sys.path so submodules can be
129+ # loaded too.
130+ if os .path .dirname (real_path ) not in sys .path :
131+ sys .path .append (os .path .dirname (real_path ))
132+ module = imp .load_source (os .path .basename (path ), real_path )
128133 for name in dir (module ):
129134 obj = getattr (module , name )
130135 if hasattr (obj , 'dredd_hooks' ) and callable (obj ):
Original file line number Diff line number Diff line change 66
77setup (
88 name = 'dredd_hooks' ,
9- version = '0.1.0 ' ,
9+ version = '0.1.1 ' ,
1010 url = 'https://github.com/apiaryio/dredd-hooks-python/' ,
1111 download_url = 'http://pypi.python.org/pypi/dredd_hooks' ,
1212 license = 'MIT License' ,
You can’t perform that action at this time.
0 commit comments