lib/origen/sub_blocks.rb in origen-0.60.16 vs lib/origen/sub_blocks.rb in origen-0.60.17
- old
+ new
@@ -317,16 +317,12 @@
# there are probably a lot more corner-cases to consider, and hopefully no one will
# really need this anyway.
# Note that override is to recreate an existing sub-block, not adding additional
# attributes to an existing one
if options[:override]
- sub_blocks.delete(name)
+ sub_blocks.delete(name.to_s)
if options[:class_name]
- begin
- constantizable = !!options[:class_name].constantize
- rescue NameError
- constantizable = false
- end
+ constantizable = !!options[:class_name].safe_constantize
# this is to handle the case where a previously instantiated subblock wont allow
# the current class name to exist
# e.g. NamespaceA::B::C
# => NameSpaceX::Y::Z
# After requiring the files, constants become sane again: