Show More
@@ -93,7 +93,7 def get_parent(globals, level): | |||||
93 | else: |
|
93 | else: | |
94 | # Normal module, so work out the package name if any |
|
94 | # Normal module, so work out the package name if any | |
95 | lastdot = modname.rfind('.') |
|
95 | lastdot = modname.rfind('.') | |
96 |
if lastdot < 0 |
|
96 | if lastdot < 0 < level: | |
97 | raise ValueError("Attempted relative import in non-package") |
|
97 | raise ValueError("Attempted relative import in non-package") | |
98 | if lastdot < 0: |
|
98 | if lastdot < 0: | |
99 | globals['__package__'] = None |
|
99 | globals['__package__'] = None |
@@ -235,7 +235,7 class Parser: | |||||
235 | return |
|
235 | return | |
236 |
|
236 | |||
237 | # map token type to a color group |
|
237 | # map token type to a color group | |
238 |
if token.LPAR <= toktype |
|
238 | if token.LPAR <= toktype <= token.OP: | |
239 | toktype = token.OP |
|
239 | toktype = token.OP | |
240 | elif toktype == token.NAME and keyword.iskeyword(toktext): |
|
240 | elif toktype == token.NAME and keyword.iskeyword(toktext): | |
241 | toktype = _KEYWORD |
|
241 | toktype = _KEYWORD |
General Comments 0
You need to be logged in to leave comments.
Login now