unix-time-to-fmt.py: fix crash without argument
Print "unknown" to stdout when unix-time-to-fmt.py was called without an argument, instead of printing a Python stack trace to stderr. It gets called that way when building outside of a git folder. Change-Id: I3ba27cc23543e47cc8a1e494c35cc33f1dc8f297
This commit is contained in:
parent
e65d9efb31
commit
10ffc82237
|
@ -11,6 +11,10 @@ Default is '%Y-%b-%d' --> 2016-Jan-01
|
|||
|
||||
import sys, time
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
print("unknown")
|
||||
exit(0)
|
||||
|
||||
fmt = '%Y-%b-%d'
|
||||
if len(sys.argv) > 2:
|
||||
fmt = sys.argv[2]
|
||||
|
|
Loading…
Reference in New Issue