Edgewall Software

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12166 closed defect (fixed)

Calling SizedDict.setdefault will raise a TypeError — at Version 2

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: 1.0.9
Component: plugin/git Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

SizedDict's setdefault method raises NotImplementedError. Previously it incorrectly raised the NotImplemented constant (which doesn't inherit from Exception).

API Changes:
Internal Changes:

Description

SizedDict should raise NotImplementedError rather than NotImplemented: tags/trac-1.1.6/tracopt/versioncontrol/git/PyGIT.py@:197#L171.

>>> from tracopt.versioncontrol.git.PyGIT import SizedDict
>>> s = SizedDict()
>>> s.setdefault(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tracopt/versioncontrol/git/PyGIT.py", line 197, in setdefault
    raise NotImplemented("SizedDict has no setdefault() method")
TypeError: 'NotImplementedType' object is not callable

More info here.

Change History (2)

comment:1 by Ryan J Ollos, 9 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: newclosed

Committed to 1.0-stable in [14243], merged to trunk in [14244].

comment:2 by Ryan J Ollos, 9 years ago

Release Notes: modified (diff)
Note: See TracTickets for help on using tickets.