Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed a few trailing backslashes.

We have always been at war with trailing backslashes.
  • Loading branch information...
commit a5b062576bda29abe93504dbcb126e644d07f9dd 1 parent ee0ef1b
@aaugustin aaugustin authored
View
4 django/conf/__init__.py
@@ -139,8 +139,8 @@ def __init__(self, settings_module):
if setting == setting.upper():
setting_value = getattr(mod, setting)
- if setting in tuple_settings and \
- isinstance(setting_value, six.string_types):
+ if (setting in tuple_settings and
+ isinstance(setting_value, six.string_types)):
raise ImproperlyConfigured("The %s setting must be a tuple. "
"Please fix your settings." % setting)
View
5 django/contrib/auth/management/__init__.py
@@ -167,8 +167,9 @@ def get_default_username(check_db=True):
default_username = get_system_username()
try:
- default_username = unicodedata.normalize('NFKD', default_username)\
- .encode('ascii', 'ignore').decode('ascii').replace(' ', '').lower()
+ default_username = (unicodedata.normalize('NFKD', default_username)
+ .encode('ascii', 'ignore').decode('ascii')
+ .replace(' ', '').lower())
except UnicodeDecodeError:
return ''
View
6 django/contrib/auth/tests/test_remote_user.py
@@ -136,8 +136,7 @@ class RemoteUserNoCreateTest(RemoteUserTest):
class that doesn't create unknown users.
"""
- backend =\
- 'django.contrib.auth.tests.test_remote_user.RemoteUserNoCreateBackend'
+ backend = 'django.contrib.auth.tests.test_remote_user.RemoteUserNoCreateBackend'
def test_unknown_user(self):
num_users = User.objects.count()
@@ -173,8 +172,7 @@ class RemoteUserCustomTest(RemoteUserTest):
and configure_user methods.
"""
- backend =\
- 'django.contrib.auth.tests.test_remote_user.CustomRemoteUserBackend'
+ backend = 'django.contrib.auth.tests.test_remote_user.CustomRemoteUserBackend'
# REMOTE_USER strings with email addresses for the custom backend to
# clean.
known_user = 'knownuser@example.com'
View
3  django/db/models/sql/expressions.py
@@ -111,8 +111,7 @@ def evaluate_date_modifier_node(self, node, qn, connection):
timedelta = node.children.pop()
sql, params = self.evaluate_node(node, qn, connection)
- if timedelta.days == 0 and timedelta.seconds == 0 and \
- timedelta.microseconds == 0:
+ if (timedelta.days == timedelta.seconds == timedelta.microseconds == 0):
return sql, params
return connection.ops.date_interval_sql(sql, node.connector, timedelta), params
View
6 django/shortcuts/__init__.py
@@ -83,8 +83,10 @@ def _get_queryset(klass):
elif isinstance(klass, ModelBase):
manager = klass._default_manager
else:
- klass__name = klass.__name__ if isinstance(klass, type) \
- else klass.__class__.__name__
+ if isinstance(klass, type)
+ klass__name = klass.__name__
+ else:
+ klass__name = klass.__class__.__name__
raise ValueError("Object is of type '%s', but must be a Django Model, "
"Manager, or QuerySet" % klass__name)
return manager.all()
View
3  django/template/response.py
@@ -133,8 +133,7 @@ def content(self, value):
class TemplateResponse(SimpleTemplateResponse):
- rendering_attrs = SimpleTemplateResponse.rendering_attrs + \
- ['_request', '_current_app']
+ rendering_attrs = SimpleTemplateResponse.rendering_attrs + ['_request', '_current_app']
def __init__(self, request, template, context=None, content_type=None,
status=None, current_app=None):
View
2  django/templatetags/i18n.py
@@ -359,7 +359,7 @@ def top(self):
asvar = self.tag()
else:
raise TemplateSyntaxError(
- "Only options for 'trans' are 'noop', " \
+ "Only options for 'trans' are 'noop', "
"'context \"xxx\"', and 'as VAR'.")
return value, noop, asvar, message_context
value, noop, asvar, message_context = TranslateParser(token.contents).top()
View
4 django/test/client.py
@@ -524,8 +524,8 @@ def login(self, **credentials):
not available.
"""
user = authenticate(**credentials)
- if user and user.is_active \
- and 'django.contrib.sessions' in settings.INSTALLED_APPS:
+ if (user and user.is_active and
+ 'django.contrib.sessions' in settings.INSTALLED_APPS):
engine = import_module(settings.SESSION_ENGINE)
# Create a fake request to store login details.
View
5 django/test/testcases.py
@@ -734,9 +734,8 @@ def _databases_names(self, include_mirrors=True):
def _reset_sequences(self, db_name):
conn = connections[db_name]
if conn.features.supports_sequence_reset:
- sql_list = \
- conn.ops.sequence_reset_by_name_sql(no_style(),
- conn.introspection.sequence_list())
+ sql_list = conn.ops.sequence_reset_by_name_sql(
+ no_style(), conn.introspection.sequence_list())
if sql_list:
with transaction.commit_on_success_unless_managed(using=db_name):
cursor = conn.cursor()
View
4 django/utils/encoding.py
@@ -152,13 +152,13 @@ def force_bytes(s, encoding='utf-8', strings_only=False, errors='strict'):
smart_unicode = smart_text
force_unicode = force_text
-smart_str.__doc__ = """\
+smart_str.__doc__ = """
Apply smart_text in Python 3 and smart_bytes in Python 2.
This is suitable for writing to sys.stdout (for instance).
"""
-force_str.__doc__ = """\
+force_str.__doc__ = """
Apply force_text in Python 3 and force_bytes in Python 2.
"""
View
2  django/utils/feedgenerator.py
@@ -272,7 +272,7 @@ def add_item_elements(self, handler, item):
# Author information.
if item["author_name"] and item["author_email"]:
- handler.addQuickElement("author", "%s (%s)" % \
+ handler.addQuickElement("author", "%s (%s)" %
(item['author_email'], item['author_name']))
elif item["author_email"]:
handler.addQuickElement("author", item["author_email"])
View
8 django/utils/html_parser.py
@@ -59,8 +59,8 @@ def parse_starttag(self, i):
attrname, rest, attrvalue = m.group(1, 2, 3)
if not rest:
attrvalue = None
- elif attrvalue[:1] == '\'' == attrvalue[-1:] or \
- attrvalue[:1] == '"' == attrvalue[-1:]:
+ elif (attrvalue[:1] == '\'' == attrvalue[-1:] or
+ attrvalue[:1] == '"' == attrvalue[-1:]):
attrvalue = attrvalue[1:-1]
if attrvalue:
attrvalue = self.unescape(attrvalue)
@@ -72,8 +72,8 @@ def parse_starttag(self, i):
lineno, offset = self.getpos()
if "\n" in self.__starttag_text:
lineno = lineno + self.__starttag_text.count("\n")
- offset = len(self.__starttag_text) \
- - self.__starttag_text.rfind("\n")
+ offset = (len(self.__starttag_text)
+ - self.__starttag_text.rfind("\n"))
else:
offset = offset + len(self.__starttag_text)
self.error("junk characters in start tag: %r"
View
4 django/utils/http.py
@@ -256,5 +256,5 @@ def is_safe_url(url, host=None):
if not url:
return False
url_info = urlparse(url)
- return (not url_info.netloc or url_info.netloc == host) and \
- (not url_info.scheme or url_info.scheme in ['http', 'https'])
+ return ((not url_info.netloc or url_info.netloc == host) and
+ (not url_info.scheme or url_info.scheme in ['http', 'https']))
View
2  tests/urlpatterns_reverse/tests.py
@@ -158,7 +158,7 @@ def test_no_urls_exception(self):
resolver = RegexURLResolver(r'^$', self.urls)
self.assertRaisesMessage(ImproperlyConfigured,
- "The included urlconf urlpatterns_reverse.no_urls "\
+ "The included urlconf urlpatterns_reverse.no_urls "
"doesn't have any patterns in it", getattr, resolver, 'url_patterns')
class URLPatternReverse(TestCase):
Please sign in to comment.
Something went wrong with that request. Please try again.