Change in osmo-gsm-manuals[master]: unix-time-to-fmt.py: fix crash without argument

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Mon Nov 12 10:21:34 UTC 2018


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/11724


Change subject: unix-time-to-fmt.py: fix crash without argument
......................................................................

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
---
M build/unix-time-to-fmt.py
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/24/11724/1

diff --git a/build/unix-time-to-fmt.py b/build/unix-time-to-fmt.py
index d081797..026e55c 100755
--- a/build/unix-time-to-fmt.py
+++ b/build/unix-time-to-fmt.py
@@ -11,6 +11,10 @@
 
 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]

-- 
To view, visit https://gerrit.osmocom.org/11724
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ba27cc23543e47cc8a1e494c35cc33f1dc8f297
Gerrit-Change-Number: 11724
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181112/bd3520de/attachment.htm>


More information about the gerrit-log mailing list