diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-03 10:08:55 -0800 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-03 10:08:55 -0800 |
| commit | c347f78cc1b2a06958f692f0622deceac534dc6b (patch) | |
| tree | c91fa9a8b5843249e2e8e6165848aae0c9fb4b17 /django/http/multipartparser.py | |
| parent | 7288e1b02b2504b1694fe14df2d81e6a354c5610 (diff) | |
Fixed all E226 violations
Diffstat (limited to 'django/http/multipartparser.py')
| -rw-r--r-- | django/http/multipartparser.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/django/http/multipartparser.py b/django/http/multipartparser.py index 21617255a8..1c64195f25 100644 --- a/django/http/multipartparser.py +++ b/django/http/multipartparser.py @@ -94,7 +94,7 @@ class MultiPartParser(object): # For compatibility with low-level network APIs (with 32-bit integers), # the chunk size should be < 2^31, but still divisible by 4. possible_sizes = [x.chunk_size for x in upload_handlers if x.chunk_size] - self._chunk_size = min([2**31-4] + possible_sizes) + self._chunk_size = min([2 ** 31 - 4] + possible_sizes) self._meta = META self._encoding = encoding or settings.DEFAULT_CHARSET @@ -267,7 +267,7 @@ class MultiPartParser(object): def IE_sanitize(self, filename): """Cleanup filename from Internet Explorer full paths.""" - return filename and filename[filename.rfind("\\")+1:].strip() + return filename and filename[filename.rfind("\\") + 1:].strip() class LazyStream(six.Iterator): @@ -512,11 +512,11 @@ class BoundaryIter(six.Iterator): end = index next = index + len(self._boundary) # backup over CRLF - last = max(0, end-1) - if data[last:last+1] == b'\n': + last = max(0, end - 1) + if data[last:last + 1] == b'\n': end -= 1 - last = max(0, end-1) - if data[last:last+1] == b'\r': + last = max(0, end - 1) + if data[last:last + 1] == b'\r': end -= 1 return end, next @@ -623,7 +623,7 @@ def parse_header(line): i = p.find(b'=') if i >= 0: name = p[:i].strip().lower().decode('ascii') - value = p[i+1:].strip() + value = p[i + 1:].strip() if len(value) >= 2 and value[:1] == value[-1:] == b'"': value = value[1:-1] value = value.replace(b'\\\\', b'\\').replace(b'\\"', b'"') |
