Skip to content

Commit

Permalink
Use os.path.basename instead of split('/')[-1]
Browse files Browse the repository at this point in the history
Fixes #10596.
  • Loading branch information
zwn committed Apr 17, 2016
1 parent a87fa10 commit b6dc348
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/script/dom/bindings/codegen/Configuration.py
Expand Up @@ -2,6 +2,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import os

from WebIDL import IDLExternalInterface, IDLInterface, WebIDLError


Expand Down Expand Up @@ -360,7 +362,7 @@ def isGlobal(self):

# Some utility methods
def getModuleFromObject(object):
return object.location.filename().split('/')[-1].split('.webidl')[0] + 'Binding'
return os.path.basename(object.location.filename()).split('.webidl')[0] + 'Binding'


def getTypesFromDescriptor(descriptor):
Expand Down

0 comments on commit b6dc348

Please sign in to comment.