Skip to content

Commit

Permalink
Update parser.py
Browse files Browse the repository at this point in the history
Full explanation is here  :  Thriftpy#269
and here : python-happybase/happybase#148
  • Loading branch information
ErKatz authored Dec 6, 2016
1 parent 013e42b commit 1230f44
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion thriftpy/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,10 @@ def parse(path, module_name=None, include_dirs=None, include_dir=None,
raise ThriftParserError('Path should end with .thrift')

url_scheme = urlparse(path).scheme
if url_scheme == '':
if url_scheme == 'file':
with open(urlparse(path).netloc) as fh:
data = fh.read()
elif url_scheme == '':
with open(path) as fh:
data = fh.read()
elif url_scheme in ('http', 'https'):
Expand Down

0 comments on commit 1230f44

Please sign in to comment.