Modify ↓
Opened 11 years ago
Closed 9 years ago
#11991 closed defect (fixed)
RegistrationError cannot initialize on Python 2.4
| Reported by: | Jun Omae | Owned by: | Steffen Hoffmann |
|---|---|---|---|
| Priority: | normal | Component: | AccountManagerPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Trac Release: | 0.12 |
Description
Unit tests fail with Trac 0.12.5 on Python 2.4. super() function only works for new-style classes. TracError class is not a new-style class on Python 2.4.
$ PYTHONPATH=. ~/venv/trac/0.12.5/bin/python acct_mgr/tests/__init__.py --skip-functional-tests
..........................................................E.EEE.EE.E..EE.
======================================================================
ERROR: test_check_error (acct_mgr.tests.register.DummyRegInspectorTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jun66j5/src/accountmanagerplugin.git/acct_mgr/tests/register.py", line 90, in test_check_error
self.check.validate_registration(self.req)
File "/home/jun66j5/src/accountmanagerplugin.git/acct_mgr/tests/register.py", line 61, in validate_registration
raise RegistrationError('Dummy check error')
File "/home/jun66j5/src/accountmanagerplugin.git/acct_mgr/register.py", line 50, in __init__
super(RegistrationError, self).__init__(message, title, show_traceback)
TypeError: super() argument 1 must be type, not classobj
....
----------------------------------------------------------------------
Ran 73 tests in 2.780s
FAILED (errors=9)
-
acct_mgr/register.py
diff --git a/acct_mgr/register.py b/acct_mgr/register.py index 5008350..8d15e2c 100644
a b class RegistrationError(TracError): 47 47 tb = 'show_traceback' 48 48 # Care for the 2nd TracError standard keyword argument only. 49 49 show_traceback = tb in kwargs and kwargs.pop(tb, False) 50 super(RegistrationError, self).__init__(message, title, show_traceback)50 TracError.__init__(self, message, title, show_traceback) 51 51 self.msg_args = args 52 52 53 53
Attachments (0)
Change History (3)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
| Status: | new → accepted |
|---|
comment:3 Changed 9 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
Note: See
TracTickets for help on using
tickets.



In 14273: