Lint fix - netlib headers

This commit is contained in:
arjun23496 2016-08-31 16:22:20 +05:30
parent dd2e0d1df3
commit e5766550f1

View File

@ -173,8 +173,8 @@ class Headers(multidict.MultiDict):
pattern = re.compile(pattern, flags) pattern = re.compile(pattern, flags)
replacements = 0 replacements = 0
flag_count = count > 0 flag_count = count > 0
fields = [] fields = []
for name, value in self.fields: for name, value in self.fields:
line, n = pattern.subn(repl, name + b": " + value, count=count) line, n = pattern.subn(repl, name + b": " + value, count=count)
try: try:
@ -185,12 +185,10 @@ class Headers(multidict.MultiDict):
pass pass
else: else:
replacements += n replacements += n
if flag_count: if flag_count:
count -= n count -= n
if count == 0: if count == 0:
break; break
fields.append((name, value)) fields.append((name, value))
self.fields = tuple(fields) self.fields = tuple(fields)
return replacements return replacements