comparison mercurial/util.py @ 2262:3d48eb68f3ee

merge with crew.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Thu, 11 May 2006 08:48:52 -0700
parents 20cf545b4725 45aef5ddcdbe
children 2f64cbaa1e92
comparison
equal deleted inserted replaced
2261:20cf545b4725 2262:3d48eb68f3ee
487 except AttributeError: 487 except AttributeError:
488 return os.stat(fp.name) 488 return os.stat(fp.name)
489 489
490 posixfile = file 490 posixfile = file
491 491
492 def is_win_9x():
493 '''return true if run on windows 95, 98 or me.'''
494 try:
495 return sys.getwindowsversion()[3] == 1
496 except AttributeError:
497 return os.name == 'nt' and 'command' in os.environ.get('comspec', '')
498
492 # Platform specific variants 499 # Platform specific variants
493 if os.name == 'nt': 500 if os.name == 'nt':
494 demandload(globals(), "msvcrt") 501 demandload(globals(), "msvcrt")
495 nulldev = 'NUL:' 502 nulldev = 'NUL:'
496 503
568 return _("exited with status %d") % code, code 575 return _("exited with status %d") % code, code
569 576
570 try: 577 try:
571 # override functions with win32 versions if possible 578 # override functions with win32 versions if possible
572 from util_win32 import * 579 from util_win32 import *
580 if not is_win_9x():
581 posixfile = posixfile_nt
573 except ImportError: 582 except ImportError:
574 pass 583 pass
575 584
576 else: 585 else:
577 nulldev = '/dev/null' 586 nulldev = '/dev/null'