comparison mercurial/pathutil.py @ 50925:d718eddf01d9

safehasattr: drop usage in favor of hasattr The two functions should now be equivalent at least in their usage in core.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 31 Aug 2023 23:56:15 +0200
parents bc83ebe07bf0
children 9d3721552b6c
comparison
equal deleted inserted replaced
50924:7a8ea1397816 50925:d718eddf01d9
375 def __contains__(self, d): 375 def __contains__(self, d):
376 # type: (bytes) -> bool 376 # type: (bytes) -> bool
377 return d in self._dirs 377 return d in self._dirs
378 378
379 379
380 if util.safehasattr(parsers, 'dirs'): 380 if hasattr(parsers, 'dirs'):
381 dirs = parsers.dirs 381 dirs = parsers.dirs
382 382
383 if rustdirs is not None: 383 if rustdirs is not None:
384 dirs = rustdirs 384 dirs = rustdirs
385 385