core.py 716 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. certifi.py
  5. ~~~~~~~~~~
  6. This module returns the installation location of cacert.pem.
  7. """
  8. import os
  9. import warnings
  10. class DeprecatedBundleWarning(DeprecationWarning):
  11. """
  12. The weak security bundle is being deprecated. Please bother your service
  13. provider to get them to stop using cross-signed roots.
  14. """
  15. def where():
  16. f = os.path.split(__file__)[0]
  17. return os.path.join(f, 'cacert.pem')
  18. def old_where():
  19. warnings.warn(
  20. "The weak security bundle is being deprecated.",
  21. DeprecatedBundleWarning
  22. )
  23. f = os.path.split(__file__)[0]
  24. return os.path.join(f, 'weak.pem')
  25. if __name__ == '__main__':
  26. print(where())