comparison mercurial/util.py @ 2647:c54ecfc360a9

util.getuser: raise exception if win32api not available.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Mon, 24 Jul 2006 09:19:25 -0700
parents e6a41cbaa260
children df5e58c84b01
comparison
equal deleted inserted replaced
2646:8796d9991100 2647:c54ecfc360a9
515 def getuser(): 515 def getuser():
516 '''return name of current user''' 516 '''return name of current user'''
517 try: 517 try:
518 return getpass.getuser() 518 return getpass.getuser()
519 except ImportError: 519 except ImportError:
520 return getuser_fallback and getuser_fallback() 520 if getuser_fallback:
521 return getuser_fallback()
521 raise util.Abort(_('user name not available - set USERNAME ' 522 raise util.Abort(_('user name not available - set USERNAME '
522 'environment variable')) 523 'environment variable'))
523 524
524 # Platform specific variants 525 # Platform specific variants
525 if os.name == 'nt': 526 if os.name == 'nt':