From a999a41ab7bfd265626bd7923492196a2fa71a0f Mon Sep 17 00:00:00 2001 From: Cody Date: Wed, 20 Apr 2016 21:06:59 +0000 Subject: [PATCH] Migrated `%` string formating --- docs/source/conf.py | 2 +- pygem/filehandler.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index c855451..a999958 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -28,7 +28,7 @@ # If your documentation needs a minimal Sphinx version, state it here. needs_sphinx = '1.4' if needs_sphinx > sphinx.__display_version__: - message = 'This project needs at least Sphinx v%s' % needs_sphinx + message = 'This project needs at least Sphinx v{0!s}'.format(needs_sphinx) raise VersionRequirementError(message) # Add any Sphinx extension module names here, as strings. They can be diff --git a/pygem/filehandler.py b/pygem/filehandler.py index 77912ac..1761dca 100644 --- a/pygem/filehandler.py +++ b/pygem/filehandler.py @@ -48,7 +48,7 @@ def _check_extension(self, filename): __, file_ext = os.path.splitext(filename) if not file_ext in self.extension: raise ValueError('The input file does not have the proper extension. \ - It is %s, instead of %s.' % (file_ext, self.extension)) + It is {0!s}, instead of {1!s}.'.format(file_ext, self.extension)) def _check_filename_type(self, filename): @@ -58,7 +58,7 @@ def _check_filename_type(self, filename): :param string filename: file to check. """ if not isinstance(filename, basestring): - raise TypeError('The given filename (%s) must be a string' % filename) + raise TypeError('The given filename ({0!s}) must be a string'.format(filename)) def _check_infile_instantiation(self, infile):