Skip to content

Commit f1ecec5

Browse files
committed
Merge pull request #63 from mathLab/autofix/wrapped2_to3_fix
Fix "Prefer `format()` over string interpolation operator" issue
2 parents 43c185f + a999a41 commit f1ecec5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# If your documentation needs a minimal Sphinx version, state it here.
2929
needs_sphinx = '1.4'
3030
if needs_sphinx > sphinx.__display_version__:
31-
message = 'This project needs at least Sphinx v%s' % needs_sphinx
31+
message = 'This project needs at least Sphinx v{0!s}'.format(needs_sphinx)
3232
raise VersionRequirementError(message)
3333

3434
# Add any Sphinx extension module names here, as strings. They can be

pygem/filehandler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _check_extension(self, filename):
4848
__, file_ext = os.path.splitext(filename)
4949
if not file_ext in self.extension:
5050
raise ValueError('The input file does not have the proper extension. \
51-
It is %s, instead of %s.' % (file_ext, self.extension))
51+
It is {0!s}, instead of {1!s}.'.format(file_ext, self.extension))
5252

5353

5454
def _check_filename_type(self, filename):
@@ -58,7 +58,7 @@ def _check_filename_type(self, filename):
5858
:param string filename: file to check.
5959
"""
6060
if not isinstance(filename, basestring):
61-
raise TypeError('The given filename (%s) must be a string' % filename)
61+
raise TypeError('The given filename ({0!s}) must be a string'.format(filename))
6262

6363

6464
def _check_infile_instantiation(self, infile):

0 commit comments

Comments
 (0)