i18n: use getattr instead of hasattr
authorAugie Fackler <durin42@gmail.com>
Mon, 25 Jul 2011 20:46:30 -0500
changeset 14975 b64538363dbe
parent 14974 a2aa75118837
child 14976 04a950b1c2ad
i18n: use getattr instead of hasattr Using getattr instead of util.safehasattr here to avoid adding another dependency for i18n.
mercurial/i18n.py
--- a/mercurial/i18n.py	Mon Jul 25 16:09:18 2011 -0500
+++ b/mercurial/i18n.py	Mon Jul 25 20:46:30 2011 -0500
@@ -9,7 +9,7 @@
 import gettext, sys, os
 
 # modelled after templater.templatepath:
-if hasattr(sys, 'frozen'):
+if getattr(sys, 'frozen', None) is not None:
     module = sys.executable
 else:
     module = __file__
@@ -61,4 +61,3 @@
     _ = lambda message: message
 else:
     _ = gettext
-