File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -444,8 +444,11 @@ def loads(data, conf=True):
444
444
kname , kval = re .match (key_regex , to_eval ).group (1 , 2 )
445
445
if "#" not in kname :
446
446
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 ):
449
452
closenum = len (re .findall ('}' , line_outside_quotes ))
450
453
while closenum > 0 :
451
454
if isinstance (lopen [0 ], Server ):
Original file line number Diff line number Diff line change @@ -119,13 +119,6 @@ def test_reflection(self):
119
119
out_data = '\n ' + nginx .dumps (inp_data )
120
120
self .assertEqual (TESTBLOCK , out_data )
121
121
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
-
129
122
def test_filtering (self ):
130
123
data = nginx .loads (TESTBLOCK )
131
124
self .assertEqual (len (data .server .filter ('Key' , 'mykey' )), 1 )
You can’t perform that action at this time.
0 commit comments