From 7f422d3e99bb21801db6f65619c876f709cdf44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s=20Combarro=20=22Piranna=22?= Date: Thu, 17 May 2012 16:38:10 +0200 Subject: Optimized IncludeStatement --- sqlparse/filters.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sqlparse') diff --git a/sqlparse/filters.py b/sqlparse/filters.py index 291a613..9ee2ce0 100644 --- a/sqlparse/filters.py +++ b/sqlparse/filters.py @@ -110,17 +110,15 @@ class IncludeStatement: elif self.detected: # Omit whitespaces if token_type in Whitespace: - pass - - # Get path of file to include - path = None + continue + # Found file path to include if token_type in String.Symbol: # if token_type in tokens.String.Symbol: + + # Get path of file to include path = join(self.dirpath, value[1:-1]) - # Include file if path was found - if path: try: f = open(path) raw_sql = f.read() -- cgit v1.2.1