#11097 closed defect (fixed)
Use of deprecated env.get_version(db) in trac core
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | general | Version: | |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
In |
||
API Changes: | |||
Internal Changes: |
Description
The docstring for Environment.get_version
in trac/env.py
states:
:since 1.0: deprecation warning: the `db` parameter is no longer used and will be removed in version 1.1.1 """
However, code in trac/env.py
on trunk calls get_version(db)
.
The following patch removes the deprecated db
argument in the function call. Trac's tests still pass after this patch is applied.
-
trac/env.py
diff --git a/trac/env.py b/trac/env.py index b63653b..d2d42b0 100644
a b class EnvironmentSetup(Component): 754 754 self._update_sample_config() 755 755 756 756 def environment_needs_upgrade(self, db): 757 dbver = self.env.get_version( db)757 dbver = self.env.get_version() 758 758 if dbver == db_default.db_version: 759 759 return False 760 760 elif dbver > db_default.db_version:
This is the only place in Trac core code where the old signature is used — all other calls to env.get_version
do not pass in the db argument.
Attachments (0)
Change History (4)
comment:1 by , 12 years ago
Milestone: | → 1.0.2 |
---|
comment:2 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 11 years ago
Owner: | set to |
---|
comment:4 by , 11 years ago
Release Notes: | modified (diff) |
---|
Good catch! It's always better to be consistent…