Nikolaj Sjujskij  committed 26d53f8

gfs: use `os.path.basename` to determine own name

  • Participants
  • Parent commits 866771d
  • Branches default

Comments (0)

Files changed (1)

 from __future__ import print_function
 from __future__ import unicode_literals
-import re, sys
+import os, re, sys
     from urllib2 import URLError, urlopen
 if __name__ == "__main__":
     # process and handle args etc.
-    selfname = sys.argv[0].split('/')[-1]
+    selfname = os.path.basename(sys.argv[0])
     if len(sys.argv) != 2:
         die("Script requires only one URL argument, see --help")