Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webutil.py @ 50611:f30ce3558c2b
safehasattr: pass attribute name as string instead of bytes
This is a step toward replacing `util.safehasattr` usage with plain `hasattr`.
The builtin function behave poorly in Python2 but this was fixed in Python3.
These change are done one by one as they tend to have a small odd to trigger
puzzling breackage.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 02 Feb 2023 17:27:50 +0100 |
parents | d44e3c45f0e4 |
children | 98b8836d0e82 |
comparison
equal
deleted
inserted
replaced
50610:b08aed45ef00 | 50611:f30ce3558c2b |
---|---|
209 b'user': s.user(), | 209 b'user': s.user(), |
210 b'date': s.date(), | 210 b'date': s.date(), |
211 b'description': s.description(), | 211 b'description': s.description(), |
212 b'branch': s.branch(), | 212 b'branch': s.branch(), |
213 } | 213 } |
214 if util.safehasattr(s, b'path'): | 214 if util.safehasattr(s, 'path'): |
215 d[b'file'] = s.path() | 215 d[b'file'] = s.path() |
216 yield d | 216 yield d |
217 | 217 |
218 | 218 |
219 def _siblings(siblings=None, hiderev=None): | 219 def _siblings(siblings=None, hiderev=None): |