moved using setting.fast_parser to fast_parser

This commit is contained in:
David Halter committed 2012-12-18 01:50:10 +01:00
1 parent 2a8660b989
commit 74a51c87cb
4 files changed
+6 -12

No files matched your search

+2
View File
@@ -138,6 +138,8 @@ class Module(parsing.Simple, parsing.Module):
class CachedFastParser(type):
""" This is a metaclass for caching `FastParser`. """
def __call__(self, code, module_path=None, user_position=None):
if not settings.fast_parser:
return parsing.PyFuzzyParser(code, module_path, user_position)
if module_path is None or module_path not in parser_cache:
p = super(CachedFastParser, self).__call__(code, module_path,
user_position)