Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Commit 4be026a

Browse files
authored
Merge pull request #270 from ErKatz/patch-1
Update parser.py
2 parents 013e42b + 1230f44 commit 4be026a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

thriftpy/parser/parser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,10 @@ def parse(path, module_name=None, include_dirs=None, include_dir=None,
536536
raise ThriftParserError('Path should end with .thrift')
537537

538538
url_scheme = urlparse(path).scheme
539-
if url_scheme == '':
539+
if url_scheme == 'file':
540+
with open(urlparse(path).netloc) as fh:
541+
data = fh.read()
542+
elif url_scheme == '':
540543
with open(path) as fh:
541544
data = fh.read()
542545
elif url_scheme in ('http', 'https'):

0 commit comments

Comments
 (0)