~mysql/mysql-utilities/1.3.2

« back to all changes in this revision

Viewing changes to mysql/utilities/common/tools.py

  • Committer: Geert Vanderkelen
  • Date: 2013-04-02 18:18:41 UTC
  • Revision ID: geert.vanderkelen@oracle.com-20130402181841-zh81s3qbg0x1tcj9
BUG#16587341: Fix error when utility has no .py extension

A ValueError was raised when a utility was running using
a none supported Python version and the utility did not
have the .py extension.

Show diffs side-by-side

added added

removed removed

Lines of Context:
324
324
            # name from where this function was called
325
325
            frm = inspect.stack()[1]
326
326
            mod = inspect.getmodule(frm[0])
327
 
            mod_name, ext = os.path.basename(mod.__file__).split('.')
 
327
            mod_name = os.path.splitext(
 
328
                os.path.basename(mod.__file__))[0]
328
329
            name = '%s utility' % mod_name
329
330
 
330
331
        # Build the error message