Commit 99430113 by Ned Batchelder

Fix pre-existing pylint violations

parent a8473505
......@@ -2,6 +2,9 @@
This file includes the monkey-patch for requests' PATCH method, as we are using
older version of django that does not contains the PATCH method in its test client.
"""
# pylint: disable=protected-access
from __future__ import unicode_literals
from urlparse import urlparse
......@@ -13,11 +16,13 @@ BOUNDARY = 'BoUnDaRyStRiNg'
MULTIPART_CONTENT = 'multipart/form-data; boundary=%s' % BOUNDARY
def request_factory_patch(self, path, data={}, content_type=MULTIPART_CONTENT, **extra):
def request_factory_patch(self, path, data=None, content_type=MULTIPART_CONTENT, **extra):
"""
Construct a PATCH request.
"""
patch_data = self._encode_data(data, content_type)
# pylint: disable=invalid-name
patch_data = self._encode_data(data or {}, content_type)
parsed = urlparse(path)
r = {
......@@ -32,11 +37,11 @@ def request_factory_patch(self, path, data={}, content_type=MULTIPART_CONTENT, *
return self.request(**r)
def client_patch(self, path, data={}, content_type=MULTIPART_CONTENT, follow=False, **extra):
def client_patch(self, path, data=None, content_type=MULTIPART_CONTENT, follow=False, **extra):
"""
Send a resource to the server using PATCH.
"""
response = super(Client, self).patch(path, data=data, content_type=content_type, **extra)
response = super(Client, self).patch(path, data=data or {}, content_type=content_type, **extra)
if follow:
response = self._handle_redirects(response, **extra)
return response
......
"""Get log settings."""
import os
import platform
import sys
......
"""Provides rooted_glob, for finding relative glob paths in another director."""
import glob2
......
......@@ -6,7 +6,7 @@ import shutil
import tempfile
def mkdtemp_clean(suffix="", prefix="tmp", dir=None):
def mkdtemp_clean(suffix="", prefix="tmp", dir=None): # pylint: disable=redefined-builtin
"""Just like mkdtemp, but the directory will be deleted when the process ends."""
the_dir = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=dir)
atexit.register(cleanup_tempdir, the_dir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment