[Piuparts-devel] piupartslib.dwke.clean_cache_files

Herbert Fortes terberh at gmail.com
Sat Feb 9 19:11:57 GMT 2019


Hi,

I did a patch to clean_cache_file().

I added lines but the 'if' condition is
more clear. Some of them can be omitted.

Names to 'get_where', 'os.path.getmtime' function returns
and comparisons.

I believe that I kept the logic.

The try/except has '(IOError, OSError)':

* os.path.getmtime()
  "Raise OSError if the file does not exist or is inaccessible."
  https://docs.python.org/2/library/os.path.html#os.path.getmtime

* os.remove()
  "If path is a directory, OSError is raised."
  https://docs.python.org/2/library/os.path.html#os.path.getmtime

* str.split() in get_where() does not raise IOError.

IOError in py3 is an alias. I removed 'IOError'
https://stackoverflow.com/questions/29347790/difference-between-ioerror-and-oserror


Patch:
https://github.com/hpfn-d/piuparts_3/pull/17



Regards,
Herbert



More information about the Piuparts-devel mailing list