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

Commit

Permalink
Merge pull request #214 from JinLiYan/develop, closes #214
Browse files Browse the repository at this point in the history
  • Loading branch information
lxyu committed Aug 26, 2016
2 parents 3cfee15 + 4125e09 commit 48a2d1d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions thriftpy/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def p_header_unit(p):
def p_include(p):
'''include : INCLUDE LITERAL'''
thrift = thrift_stack[-1]

if thrift.__thrift_file__ is None:
raise ThriftParserError('Unexcepted include statement while loading'
'from file like object.')

for include_dir in include_dirs_:
replace_include_dirs = [os.path.dirname(thrift.__thrift_file__)] \
+ include_dirs_
for include_dir in replace_include_dirs:
path = os.path.join(include_dir, p[2])
if os.path.exists(path):
child = parse(path)
Expand Down Expand Up @@ -154,7 +154,6 @@ def p_const_map_item(p):
def p_const_ref(p):
'''const_ref : IDENTIFIER'''
child = thrift_stack[-1]

for name in p[1].split('.'):
father = child
child = getattr(child, name, None)
Expand Down Expand Up @@ -618,7 +617,7 @@ def _cast_bool(v):


def _cast_byte(v):
assert isinstance(v, str)
assert isinstance(v, int)
return v


Expand Down

0 comments on commit 48a2d1d

Please sign in to comment.