Skip to content

Commit f22b190

Browse files
committed
fix locations without normal keys, closes #6
1 parent a61a2ce commit f22b190

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

nginx.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,11 @@ def loads(data, conf=True):
439439
to_eval = line
440440
if re.match(cmt_regex, line):
441441
to_eval = re.match(cmt_regex, line).group(1)
442-
kname, kval = re.match(key_regex, to_eval).group(1, 2)
443-
if "#" not in kname:
444-
k = Key(kname, kval)
445-
lopen[0].add(k)
442+
if re.match(key_regex, to_eval):
443+
kname, kval = re.match(key_regex, to_eval).group(1, 2)
444+
if "#" not in kname:
445+
k = Key(kname, kval)
446+
lopen[0].add(k)
446447
if re.match(r'.*}', line):
447448
closenum = len(re.findall('}', line))
448449
while closenum > 0:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name='python-nginx',
7-
version='1.0',
7+
version='1.1',
88
description='Create and modify nginx serverblock configs in Python',
99
author='Jacob Cook',
1010
author_email='jacob@peakwinter.net',

0 commit comments

Comments
 (0)