'Convert the name of an extension (eg. "foo.bar") into the name
of the file from which it will be loaded (eg. "foo/bar.so", or
"foo\bar.pyd").'

def get_ext_filename(self, ext_name):

    from distutils.sysconfig import get_config_var
    ext_path = string.split(ext_name, '.')
    if (os.name == 'os2'):
        ext_path[(len(ext_path) - 1)] = ext_path[(len(ext_path) - 1)][:8]
    so_ext = get_config_var('SO')
    if ((os.name == 'nt') and self.debug):
        return ((os.path.join(*ext_path) + '_d') + so_ext)
    return (os.path.join(*ext_path) + so_ext)
