summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/tracking.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/tracking.py b/modules/tracking.py
index 64db2b6..32d83a2 100644
--- a/modules/tracking.py
+++ b/modules/tracking.py
@@ -245,7 +245,7 @@ class Module:
if len(results):
msg = results
- else:
+ elif len(code):
try:
# type:code is handled by get_tracking_module()
tm = get_tracking_module(code)
@@ -255,10 +255,10 @@ class Module:
msg.append('\002%s\002 %s - %s' % (package.code, package.date, package.desc.decode('utf8')))
elif code:
msg = 'Failed to fetch tracking data for \002%s\002.' % code.decode('utf8')
- else:
- msg = 'No tracking number given or registered.'
except PackageError as e:
msg = str(e)
+ else:
+ msg = 'No tracking number given or registered.'
finally:
session.close()
return msg