]> source.dussan.org Git - redmine.git/commitdiff
use Python getattr instead of hasattr (#16177)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 26 Feb 2014 16:28:43 +0000 (16:28 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 26 Feb 2014 16:28:43 +0000 (16:28 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12935 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/scm/adapters/mercurial/redminehelper.py

index 6056dd803acec8c19d66ce4971a213e082beb009..b7d98a18f228ceff087379fb6ab97e8dc3d56cb8 100644 (file)
@@ -79,7 +79,7 @@ def _tags(ui, repo):
 def _branches(ui, repo):
     # see mercurial/commands.py:branches
     def iterbranches():
-        if hasattr(repo, 'branchtags'):
+        if getattr(repo, 'branchtags', None) is not None:
             # Mercurial < 2.9
             for t, n in repo.branchtags().iteritems():
                 yield t, n, repo.changelog.rev(n)