[Python-checkins] cpython: Remove uses of % with str.format.

brett.cannon python-checkins at python.org
Fri Oct 12 16:00:40 CEST 2012


http://hg.python.org/cpython/rev/987a8724b220
changeset:   79692:987a8724b220
user:        Brett Cannon <brett at python.org>
date:        Fri Oct 12 10:00:34 2012 -0400
summary:
  Remove uses of % with str.format.

files:
  Lib/importlib/_bootstrap.py |     6 +-
  Python/importlib.h          |  7534 +++++++++++-----------
  2 files changed, 3771 insertions(+), 3769 deletions(-)


diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -237,7 +237,7 @@
                     self.wakeup.release()
 
     def __repr__(self):
-        return "_ModuleLock(%r) at %d" % (self.name, id(self))
+        return "_ModuleLock({!r}) at {}".format(self.name, id(self))
 
 
 class _DummyModuleLock:
@@ -258,7 +258,7 @@
         self.count -= 1
 
     def __repr__(self):
-        return "_DummyModuleLock(%r) at %d" % (self.name, id(self))
+        return "_DummyModuleLock({!r}) at {}".format(self.name, id(self))
 
 
 # The following two functions are for consumption by Python/import.c.
@@ -1434,7 +1434,7 @@
         return path_hook_for_FileFinder
 
     def __repr__(self):
-        return "FileFinder(%r)" % (self.path,)
+        return "FileFinder({!r})".format(self.path)
 
 
 # Import itself ###############################################################
diff --git a/Python/importlib.h b/Python/importlib.h
--- a/Python/importlib.h
+++ b/Python/importlib.h
[stripped]

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list