Added error information on assert failure
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Tue, 23 Aug 2011 08:47:47 +0000 (08:47 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Tue, 23 Aug 2011 08:47:47 +0000 (08:47 +0000)
bin/ntools.py

index 61085dbb831c0e18b9bec8f4088fea4272b4bd24..3236319f676c1cb6c06b5c1692991be2a04b9409 100644 (file)
@@ -59,7 +59,7 @@ def strmmsi_to_mmsi(strmmsi):
     if strmmsi.isdigit():
         return int(strmmsi)
     else:
-        assert strmmsi[3:5] == 'MI'
+        assert strmmsi[3:5] == 'MI', 'Invalid strmmsi ' + strmmsi
         strmmsi = strmmsi[:3]+'00'+strmmsi[5:]
         return int('-'+strmmsi)