Ticket #6562: 6562.diff

File 6562.diff, 967 bytes (added by Karen Tracey <kmtracey@…>, 17 years ago)
  • setup.py

     
    2727# an easy way to do this.
    2828packages, data_files = [], []
    2929root_dir = os.path.dirname(__file__)
    30 django_dir = os.path.join(root_dir, 'django')
    31 pieces = fullsplit(root_dir)
    32 if pieces[-1] == '':
    33     len_root_dir = len(pieces) - 1
    34 else:
    35     len_root_dir = len(pieces)
     30if root_dir != '':
     31    os.chdir(root_dir)
     32django_dir = 'django'
    3633
    3734for dirpath, dirnames, filenames in os.walk(django_dir):
    3835    # Ignore dirnames that start with '.'
    3936    for i, dirname in enumerate(dirnames):
    4037        if dirname.startswith('.'): del dirnames[i]
    4138    if '__init__.py' in filenames:
    42         packages.append('.'.join(fullsplit(dirpath)[len_root_dir:]))
     39        packages.append('.'.join(fullsplit(dirpath)))
    4340    elif filenames:
    4441        data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
    4542
Back to Top