Skip to content
Permalink
Browse files

Merge pull request #715 from krekoten/module_const_get

Module#const_get
  • Loading branch information
alex committed May 19, 2013
2 parents 32c1cb2 + a2502b6 commit 5d64b2bb96ba63de574fe8b4aef437d331bf84d2

This file was deleted.

This file was deleted.

@@ -505,7 +505,11 @@ def method_constants(self, space, w_inherit=None):

@classdef.method("const_missing", name="symbol")
def method_const_missing(self, space, name):
raise space.error(space.w_NameError, "uninitialized constant %s" % name)
if self is space.w_object:
raise space.error(space.w_NameError, "uninitialized constant %s" % (name))
else:
self_name = space.obj_to_s(self)
raise space.error(space.w_NameError, "uninitialized constant %s::%s" % (self_name, name))

@classdef.method("class_eval", string="str", filename="str")
@classdef.method("module_eval", string="str", filename="str")
@@ -541,10 +545,7 @@ def method_const_get(self, space, const, inherit=True):
else:
w_res = self.find_local_const(space, const)
if w_res is None:
name = space.obj_to_s(self)
raise space.error(space.w_NameError,
"uninitialized constant %s::%s" % (name, const)
)
return space.send(self, "const_missing", [space.newsymbol(const)])
return w_res

@classdef.method("const_set", const="symbol")

0 comments on commit 5d64b2b

Please sign in to comment.