Mercurial > hg
changeset 15656:4f5a78fa4917
util: clean up function ordering
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 15 Dec 2011 14:59:22 -0600 |
parents | 5402fd9dd13e |
children | d976b1ef6760 |
files | mercurial/util.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/util.py Thu Dec 15 14:37:36 2011 -0600 +++ b/mercurial/util.py Thu Dec 15 14:59:22 2011 -0600 @@ -74,6 +74,11 @@ # Python compatibility +_notset = object() + +def safehasattr(thing, attr): + return getattr(thing, attr, _notset) is not _notset + def sha1(s=''): ''' Low-overhead wrapper around Python's SHA support @@ -87,10 +92,6 @@ return _fastsha1(s) -_notset = object() -def safehasattr(thing, attr): - return getattr(thing, attr, _notset) is not _notset - def _fastsha1(s=''): # This function will import sha1 from hashlib or sha (whichever is # available) and overwrite itself with it on the first call.