Skip to content

Commit

Permalink
fix NameError.new spec
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel committed Mar 19, 2017
1 parent e23499b commit 1c7f1f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion spec/tags/core/exception/name_error_tags.txt

This file was deleted.

9 changes: 9 additions & 0 deletions topaz/objects/exceptionobject.py
Expand Up @@ -159,6 +159,15 @@ class W_NameError(W_StandardError):
classdef = ClassDef("NameError", W_StandardError.classdef)
method_allocate = new_exception_allocate(classdef)

@classdef.method("initialize")
def method_initialize(self, space, w_msg=None, w_name=None):
W_ExceptionObject.method_initialize(self, space, w_msg)
self.w_name = w_name or space.w_nil

@classdef.method("name")
def method_name(self, space):
return self.w_name


class W_NoMethodError(W_NameError):
classdef = ClassDef("NoMethodError", W_NameError.classdef)
Expand Down

0 comments on commit 1c7f1f9

Please sign in to comment.