2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-05 00:35:33 +00:00

python: Use os.path.basename instead of open-coding it.

Reported-by: Justin Pettit <jpettit@nicira.com>
This commit is contained in:
Ben Pfaff
2011-01-12 13:43:22 -08:00
parent 6eb59a8f0a
commit a44d74d752
2 changed files with 5 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2010 Nicira Networks
# Copyright (c) 2010, 2011 Nicira Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,10 +13,10 @@
# limitations under the License.
import os
import os.path
import sys
_argv0 = sys.argv[0]
PROGRAM_NAME = _argv0[_argv0.rfind('/') + 1:]
PROGRAM_NAME = os.path.basename(sys.argv[0])
def abs_file_name(dir, file_name):
"""If 'file_name' starts with '/', returns a copy of 'file_name'.