Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoided %r formatting on possibly unicode strings.

The u prefix looks bad on Python 2.
  • Loading branch information...
commit 14bcbd9937f50ec21196dbb2bc3126e6a4427b37 1 parent efddae2
Aymeric Augustin aaugustin authored
Showing with 5 additions and 5 deletions.
  1. +3 −3 django/apps/base.py
  2. +2 −2 django/apps/registry.py
6 django/apps/base.py
View
@@ -83,13 +83,13 @@ def create(cls, entry):
# 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 @@ def create(cls, entry):
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)
4 django/apps/registry.py
View
@@ -181,9 +181,9 @@ def get_app_config(self, app_label, only_with_models_module=False):
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.
Please sign in to comment.
Something went wrong with that request. Please try again.