From 49b0325ab09e087fd6b48d3fb8c59f06a0af985b Mon Sep 17 00:00:00 2001 From: lethliel Date: Thu, 11 Jul 2019 13:43:22 +0200 Subject: [PATCH] fix error when f.size is None but f.mtime is not The if statement just catches the case when both (f.size and f.mtime) are None. Added two elifs to catch the cases that just one of them is None. --- osc/commandline.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osc/commandline.py b/osc/commandline.py index 8ea37ba3..36e0f31f 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -393,6 +393,10 @@ class Osc(cmdln.Cmdln): for f in result[1]: if f.size is None and f.mtime is None: print("%9s %12s %-40s" % ('unknown', 'unknown', f.name)) + elif f.size is None and f.mtime is not None: + print("%9s %s %-40s" % ('unknown', shorttime(f.mtime), f.name)) + elif f.size is not None and f.mtime is None: + print("%9d %12s %-40s" % (f.size, 'unknown', f.name)) else: print("%9d %s %-40s" % (f.size, shorttime(f.mtime), f.name)) else: