Skip to content

Commit 9d8e495

Browse files
author
Aleksei_Philippov
committed
fixed whitespace after close curly braces
1 parent 327e5a8 commit 9d8e495

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

nginx.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,11 @@ def loads(data, conf=True):
444444
kname, kval = re.match(key_regex, to_eval).group(1, 2)
445445
if "#" not in kname:
446446
k = Key(kname, kval)
447-
lopen[0].add(k)
448-
if re.match(r'(^(?!#)([^#]*[}]{1})$)|(\s*{$)', line_outside_quotes):
447+
try:
448+
lopen[0].add(k)
449+
except:
450+
pass
451+
if re.match(r'(^(?!#)([^#]*[}]{1}\s*)$)|(\s*{$)', line_outside_quotes):
449452
closenum = len(re.findall('}', line_outside_quotes))
450453
while closenum > 0:
451454
if isinstance(lopen[0], Server):

tests.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,6 @@ def test_reflection(self):
119119
out_data = '\n' + nginx.dumps(inp_data)
120120
self.assertEqual(TESTBLOCK, out_data)
121121

122-
# def test_reflection2(self):
123-
# inp_data = nginx.loads(SECONDTESTBLOCK)
124-
# out_data = '\n' + nginx.dumps(inp_data)
125-
# print(out_data)
126-
# print(SECONDTESTBLOCK)
127-
# self.assertEqual(TESTBLOCK, out_data)
128-
129122
def test_filtering(self):
130123
data = nginx.loads(TESTBLOCK)
131124
self.assertEqual(len(data.server.filter('Key', 'mykey')), 1)

0 commit comments

Comments
 (0)