equal
deleted
inserted
replaced
517 try: |
517 try: |
518 return sys.getwindowsversion()[3] == 1 |
518 return sys.getwindowsversion()[3] == 1 |
519 except AttributeError: |
519 except AttributeError: |
520 return os.name == 'nt' and 'command' in os.environ.get('comspec', '') |
520 return os.name == 'nt' and 'command' in os.environ.get('comspec', '') |
521 |
521 |
522 getuser_fallback = None |
|
523 |
|
524 def getuser(): |
|
525 '''return name of current user''' |
|
526 try: |
|
527 return getpass.getuser() |
|
528 except ImportError: |
|
529 # import of pwd will fail on windows - try fallback |
|
530 if getuser_fallback: |
|
531 return getuser_fallback() |
|
532 # raised if win32api not available |
|
533 raise Abort(_('user name not available - set USERNAME ' |
|
534 'environment variable')) |
|
535 |
|
536 # Platform specific variants |
522 # Platform specific variants |
537 if os.name == 'nt': |
523 if os.name == 'nt': |
538 demandload(globals(), "msvcrt") |
524 demandload(globals(), "msvcrt") |
539 nulldev = 'NUL:' |
525 nulldev = 'NUL:' |
540 |
526 |