summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Drung <bdrung@debian.org>2014-05-09 23:47:43 +0200
committerBenjamin Drung <bdrung@debian.org>2014-05-09 23:47:43 +0200
commit6c2571614022d59d3369147859d899e75d24acf4 (patch)
treec145eaac8df36a430fd1dd51b90940071bbdb2e8
parent4732dae8f2bc34a807abef6ffbab8d28467b08b6 (diff)
Print script name in error message.
-rwxr-xr-xamo-changelog6
1 files changed, 4 insertions, 2 deletions
diff --git a/amo-changelog b/amo-changelog
index a6c7468..ad4a823 100755
--- a/amo-changelog
+++ b/amo-changelog
@@ -18,9 +18,10 @@
from __future__ import print_function
import argparse
+import os
+import sys
import urllib2
import xml.etree.cElementTree as etree
-import sys
URL_TEMPLATE = "https://addons.mozilla.org/en-US/addon/{ext}/versions/format:rss"
@@ -36,7 +37,8 @@ def main():
try:
fp = urllib2.urlopen(url)
except urllib2.HTTPError as error:
- print("For extension '%s', error fetching '%s': %s" % (options.extension, url, error),
+ print("%s: For extension '%s', error fetching '%s': %s" %
+ (os.path.basename(sys.argv[0]), options.extension, url, error),
file=sys.stderr)
return 1
try: