Skip to content
This repository was archived by the owner on Jun 4, 2022. It is now read-only.

Commit 7f422d3

Browse files
author
Jesús Leganés Combarro "Piranna"
committed
Optimized IncludeStatement
1 parent c45e0c6 commit 7f422d3

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

sqlparse/filters.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,15 @@ def process(self, stack, stream):
110110
elif self.detected:
111111
# Omit whitespaces
112112
if token_type in Whitespace:
113-
pass
114-
115-
# Get path of file to include
116-
path = None
113+
continue
117114

115+
# Found file path to include
118116
if token_type in String.Symbol:
119117
# if token_type in tokens.String.Symbol:
118+
119+
# Get path of file to include
120120
path = join(self.dirpath, value[1:-1])
121121

122-
# Include file if path was found
123-
if path:
124122
try:
125123
f = open(path)
126124
raw_sql = f.read()

0 commit comments

Comments
 (0)