lib/pycall/import.rb in pycall-0.1.0.alpha.20170224b vs lib/pycall/import.rb in pycall-0.1.0.alpha.20170224
- old
+ new
@@ -20,19 +20,17 @@
end
check_valid_module_variable_name(mod_name, as)
mod = PyCall.import_module(mod_name)
- raise PyError.fetch unless mod
-
define_singleton_method(as) { mod }
end
def pyfrom(mod_name, import: nil)
raise ArgumentError, "missing identifiers to be imported" unless import
mod = PyCall.import_module(mod_name)
- raise PyError.fetch unless mod
+ raise "Unable to import module #{mod_name}" unless mod # TODO: PyError
case import
when Hash
import.each do |attr, as|
val = PyCall.getattr(mod, attr)