Skip to content
Snippets Groups Projects
Commit 30d3b320 authored by Todd Gamblin's avatar Todd Gamblin
Browse files

Bug fix in how class names are determined

parent 208db9b0
Branches
Tags
No related merge requests found
......@@ -203,7 +203,10 @@ def class_name_for_package_name(pkg_name):
conflicts don't matter because the classes are in different modules.
"""
validate_package_name(pkg_name)
class_name = string.capwords(pkg_name.replace('_', '-'), '-')
class_name = pkg_name.replace('_', '-')
class_name = string.capwords(class_name, '-')
class_name = class_name.replace('-', '')
# If a class starts with a number, prefix it with Number_ to make it a valid
# Python class name.
......@@ -241,7 +244,7 @@ def get_class_for_package_name(pkg_name):
if not re.match(r'%s' % spack.module_path, spack.packages_path):
raise RuntimeError("Packages path is not a submodule of spack.")
class_name = pkg_name.capitalize()
class_name = class_name_for_package_name(pkg_name)
try:
module_name = "%s.%s" % (packages_module(), pkg_name)
module = __import__(module_name, fromlist=[class_name])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment