Ticket #1405: pwd-patch.patch

File pwd-patch.patch, 1018 bytes (added by anonymous, 19 years ago)

try to import pwd, catch exception

  • C:/Python24/Lib/site-packages/django/core/management.py

     
    661661    "Creates a superuser account."
    662662    from django.core import validators
    663663    from django.contrib.auth.models import User
    664     import getpass, pwd
     664   
     665    default_username = ''
     666   
     667    try:
     668        import getpass, pwd
     669        # Determine the current system user's username, to use as a default.
     670        default_username = pwd.getpwuid(os.getuid())[0].replace(' ', '').lower()
     671    except ImportError:
     672        pass
    665673
    666     # Determine the current system user's username, to use as a default.
    667     default_username = pwd.getpwuid(os.getuid())[0].replace(' ', '').lower()
    668 
    669674    # Determine whether the default username is taken, so we don't display
    670675    # it as an option.
    671676    if default_username:
Back to Top