summaryrefslogtreecommitdiff
path: root/django/apps
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-27 23:17:59 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-27 23:19:23 +0100
commit14bcbd9937f50ec21196dbb2bc3126e6a4427b37 (patch)
treefc1750f55b8eb577d46d7ad1e271ab9bf33eb544 /django/apps
parentefddae252ce8fe469196839a29a564c0b4942c89 (diff)
Avoided %r formatting on possibly unicode strings.
The u prefix looks bad on Python 2.
Diffstat (limited to 'django/apps')
-rw-r--r--django/apps/base.py6
-rw-r--r--django/apps/registry.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/django/apps/base.py b/django/apps/base.py
index 4102780560..40b72c9448 100644
--- a/django/apps/base.py
+++ b/django/apps/base.py
@@ -83,13 +83,13 @@ class AppConfig(object):
# would raise when <mod_path> exists but not <cls_name>, with
# more context (Python just says "cannot import name ...").
raise ImportError(
- "cannot import name %r from %r" % (cls_name, mod_path))
+ "cannot import name '%s' from '%s'" % (cls_name, mod_path))
# Check for obvious errors. (This check prevents duck typing, but
# it could be removed if it became a problem in practice.)
if not issubclass(cls, AppConfig):
raise ImproperlyConfigured(
- "%r isn't a subclass of AppConfig." % entry)
+ "'%s' isn't a subclass of AppConfig." % entry)
# Obtain app name here rather than in AppClass.__init__ to keep
# all error checking for entries in INSTALLED_APPS in one place.
@@ -97,7 +97,7 @@ class AppConfig(object):
app_name = cls.name
except AttributeError:
raise ImproperlyConfigured(
- "%r must supply a name attribute." % entry)
+ "'%s' must supply a name attribute." % entry)
# Ensure app_names points to a valid module.
app_module = import_module(app_name)
diff --git a/django/apps/registry.py b/django/apps/registry.py
index 737fc960b8..8a25bad281 100644
--- a/django/apps/registry.py
+++ b/django/apps/registry.py
@@ -181,9 +181,9 @@ class Apps(object):
app_config = self.app_configs.get(app_label)
if app_config is None:
- raise LookupError("No installed app with label %r." % app_label)
+ raise LookupError("No installed app with label '%s'." % app_label)
if only_with_models_module and app_config.models_module is None:
- raise LookupError("App with label %r doesn't have a models module." % app_label)
+ raise LookupError("App with label '%s' doesn't have a models module." % app_label)
return app_config
# This method is performance-critical at least for Django's test suite.