comparison hgext/convert/git.py @ 14945:11aad09a6370

hgext: replace uses of hasattr with util.safehasattr
author Augie Fackler <durin42@gmail.com>
date Mon, 25 Jul 2011 20:37:12 -0500
parents d297ee0b2d94
children 589aab2ca716 101c8a1befb1
comparison
equal deleted inserted replaced
14944:e2c413bde8a5 14945:11aad09a6370
14 14
15 class convert_git(converter_source): 15 class convert_git(converter_source):
16 # Windows does not support GIT_DIR= construct while other systems 16 # Windows does not support GIT_DIR= construct while other systems
17 # cannot remove environment variable. Just assume none have 17 # cannot remove environment variable. Just assume none have
18 # both issues. 18 # both issues.
19 if hasattr(os, 'unsetenv'): 19 if util.safehasattr(os, 'unsetenv'):
20 def gitopen(self, s, noerr=False): 20 def gitopen(self, s, noerr=False):
21 prevgitdir = os.environ.get('GIT_DIR') 21 prevgitdir = os.environ.get('GIT_DIR')
22 os.environ['GIT_DIR'] = self.path 22 os.environ['GIT_DIR'] = self.path
23 try: 23 try:
24 if noerr: 24 if noerr: