[Piuparts-devel] piupartslib.dwke.clean_cache_files

Herbert Fortes terberh at gmail.com
Sun Feb 10 11:13:46 GMT 2019


Well,

'if pkgspec not in logdict' must be the first then
the rest.

I am stopping these kind of suggestions for now.



Regards,
Herbert

On 2/9/19 5:11 PM, Herbert Fortes wrote:
> 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