summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-01-12 13:43:22 -0800
committerBen Pfaff <blp@nicira.com>2011-01-12 13:51:42 -0800
commita44d74d75294e358e501cc83fd35e6a5e50ebf0b (patch)
tree31655308f7a3efbe8bcebe217475414c006641a2 /build-aux
parent6eb59a8f0aca761d4798d8197709b45801968065 (diff)
downloadopenvswitch-a44d74d75294e358e501cc83fd35e6a5e50ebf0b.tar.gz
python: Use os.path.basename instead of open-coding it.
Reported-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/check-structs6
1 files changed, 2 insertions, 4 deletions
diff --git a/build-aux/check-structs b/build-aux/check-structs
index f582e2bd7..536045fe4 100755
--- a/build-aux/check-structs
+++ b/build-aux/check-structs
@@ -1,5 +1,6 @@
#! /usr/bin/python
+import os.path
import sys
import re
@@ -193,10 +194,7 @@ def checkStructs():
sys.exit(1)
if '--help' in sys.argv:
- argv0 = sys.argv[0]
- slash = argv0.rfind('/')
- if slash:
- argv0 = argv0[slash + 1:]
+ argv0 = os.path.basename(sys.argv[0])
print '''\
%(argv0)s, for checking struct and struct member alignment
usage: %(argv0)s HEADER [HEADER]...