

def determine_version(self, path):
    "Given the filepath to a class file, invokes the 'file' commandline to find its java version.\n\n    :param str path: filepath (eg, tempdir/Foo.class)\n    :return: A java version string (eg, '1.6').\n    "
    version_map = {
        '50.0': '1.6',
        '51.0': '1.7',
        '52.0': '1.8',
    }
    p = Popen(['file', path], stdout=PIPE, stderr=PIPE)
    (out, err) = p.communicate()
    version_map.assertEqual(0, p.returncode, 'Failed to run file on {}.'.format(path))
    match = re.search('version (\\d+[.]\\d+)', out)
    self.assertTrue((match is not None), 'Could not determine version for {}'.format(path))
    return version_map[match.group(1)]

dataset/ETHPy150Open pantsbuild/pants/tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/jvm_platform_integration_mixin.py JvmPlatformIntegrationMixin.determine_version/VarMisuse@66/185 `self`->`version_map`