From d626c99b6288afc4708d72f668b45a29d3263d22 Mon Sep 17 00:00:00 2001 From: ptmcg Date: Wed, 9 Jan 2019 17:18:22 -0600 Subject: Add enumerated place holders for strings that invoke str.format(), for Py2 compatibility --- examples/statemachine/libraryBookDemo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/statemachine/libraryBookDemo.py') diff --git a/examples/statemachine/libraryBookDemo.py b/examples/statemachine/libraryBookDemo.py index 84108e5..2e60eac 100644 --- a/examples/statemachine/libraryBookDemo.py +++ b/examples/statemachine/libraryBookDemo.py @@ -19,7 +19,7 @@ class Book: return attr def __str__(self): - return "{}: {}".format(self.__class__.__name__, self._state) + return "{0}: {1}".format(self.__class__.__name__, self._state) class RestrictedBook(Book): @@ -35,7 +35,7 @@ class RestrictedBook(Book): if user in self._authorized_users: self._state = self._state.checkout() else: - raise Exception("{} could not check out restricted book".format((user, "anonymous")[user is None])) + raise Exception("{0} could not check out restricted book".format((user, "anonymous")[user is None])) def run_demo(): -- cgit v1.2.1