File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 2
2
dist
3
3
build
4
4
* .pyc
5
+ * .egg-info
Original file line number Diff line number Diff line change @@ -414,6 +414,7 @@ def loads(data, conf=True):
414
414
f = Conf () if conf else []
415
415
lopen = []
416
416
for line in data .split ('\n ' ):
417
+ line_outside_quotes = re .sub (r'"([^"]+)"|\'([^\']+)\'|\\S+' , '' , line )
417
418
if re .match (r'\s*server\s*{' , line ):
418
419
s = Server ()
419
420
lopen .insert (0 , s )
@@ -444,8 +445,8 @@ def loads(data, conf=True):
444
445
if "#" not in kname :
445
446
k = Key (kname , kval )
446
447
lopen [0 ].add (k )
447
- if re .match (r'.*}' , line ):
448
- closenum = len (re .findall ('}' , line ))
448
+ if re .match (r'.*}' , line_outside_quotes ):
449
+ closenum = len (re .findall ('}' , line_outside_quotes ))
449
450
while closenum > 0 :
450
451
if isinstance (lopen [0 ], Server ):
451
452
f .add (lopen [0 ]) if conf else f .append (lopen [0 ])
You can’t perform that action at this time.
0 commit comments