Ignore:
Timestamp:
Dec 26, 2018, 8:00:40 PM (8 months ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Remove positional argument specifiers for `format`

In strings for `format` calls, remove the digits for positional
arguments. For example, "{0}, {1}" becomes "{}, {}".
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ftputil/stat_cache.py

    r1718 r1723  
    8585        except ftputil.lrucache.CacheKeyError:
    8686            raise ftputil.error.CacheMissError(
    87                     "no entry for path {0} in cache".format(path))
     87                    "no entry for path {} in cache".format(path))
    8888
    8989    def clear(self):
     
    103103        # want to introduce a reference to the `FTPHost` object for
    104104        # only that purpose.
    105         assert path.startswith("/"), ("{0} must be an absolute path".
     105        assert path.startswith("/"), ("{} must be an absolute path".
    106106                                      format(path))
    107107        try:
     
    122122            self.invalidate(path)
    123123            raise ftputil.error.CacheMissError(
    124                     "entry for path {0} has expired".format(path))
     124                    "entry for path {} has expired".format(path))
    125125        else:
    126126            #XXX I don't know if this may raise a `CacheMissError` in
     
    130130            except ftputil.lrucache.CacheKeyError:
    131131                raise ftputil.error.CacheMissError(
    132                         "entry for path {0} not found".format(path))
     132                        "entry for path {} not found".format(path))
    133133
    134134    def __setitem__(self, path, stat_result):
     
    169169        lines = []
    170170        for key in sorted(self._cache):
    171             lines.append("{0}: {1}".format(key, self[key]))
     171            lines.append("{}: {}".format(key, self[key]))
    172172        return "\n".join(lines)
Note: See TracChangeset for help on using the changeset viewer.