diff --git a/mercurial/util.py b/mercurial/util.py index 5402fd9dd13ee73e66a732ad3d2f40dad1d0a221_bWVyY3VyaWFsL3V0aWwucHk=..4f5a78fa4917bbeaecdab35eb6b19f49243d70a2_bWVyY3VyaWFsL3V0aWwucHk= 100644 --- a/mercurial/util.py +++ b/mercurial/util.py @@ -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.