m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
709 B

6 months ago
  1. import os
  2. import sys
  3. if 'setuptools' in sys.modules:
  4. from setuptools.command.bdist_rpm import bdist_rpm as old_bdist_rpm
  5. else:
  6. from distutils.command.bdist_rpm import bdist_rpm as old_bdist_rpm
  7. class bdist_rpm(old_bdist_rpm):
  8. def _make_spec_file(self):
  9. spec_file = old_bdist_rpm._make_spec_file(self)
  10. # Replace hardcoded setup.py script name
  11. # with the real setup script name.
  12. setup_py = os.path.basename(sys.argv[0])
  13. if setup_py == 'setup.py':
  14. return spec_file
  15. new_spec_file = []
  16. for line in spec_file:
  17. line = line.replace('setup.py', setup_py)
  18. new_spec_file.append(line)
  19. return new_spec_file