diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2015-09-10 07:12:11 -0400 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-09-10 07:12:11 -0400 |
| commit | fcf7cc598a7562e4ad2d0127933d00c0835beae8 (patch) | |
| tree | 17ef64c113ff0c2eeefb63e0c153879997c70e3e /ci | |
| parent | a8b69abb20df4cc6d4960ad43076d28a8cf938b1 (diff) | |
| download | python-coveragepy-fcf7cc598a7562e4ad2d0127933d00c0835beae8.tar.gz | |
More diagnostics
Diffstat (limited to 'ci')
| -rw-r--r-- | ci/show_py.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ci/show_py.py b/ci/show_py.py new file mode 100644 index 0000000..4b7466a --- /dev/null +++ b/ci/show_py.py @@ -0,0 +1,40 @@ +"""Show useful things about a Python installation.""" + +import sys + + +def main(): + print("Python version:\n {0}".format(sys.version.replace("\n", "\n "))) + print("Python prefix: {0}".format(sys.prefix)) + if hasattr(sys, "real_prefix"): + print("This is a virtualenv. The real prefix is: {0}".format(sys.real_prefix)) + else: + print("This is not a virtualenv.") + + if sys.maxsize == 2**63-1: + indicates = "indicating 64-bit" + elif sys.maxsize == 2**31-1: + indicates = "indicating 32-bit" + else: + indicates = "not sure what that means" + print("sys.maxsize: {0}, {1}".format(sys.maxsize, indicates)) + if hasattr(sys, "maxint"): + print("sys.maxint: {0}".format(sys.maxint)) + else: + print("sys.maxint doesn't exist") + + if sys.version_info < (3, 0): + if sys.maxunicode == 1114111: + indicates = "indicating a wide Unicode build" + elif sys.maxunicode == 65535: + indicates = "indicating a narrow Unicode build" + else: + indicates = "as all Python 3 have" + print("sys.maxunicode: {0}, {1}".format(sys.maxunicode, indicates)) + + print("sys.getdefaultencoding(): {0}".format(sys.getdefaultencoding())) + print("sys.getfilesystemencoding(): {0}".format(sys.getfilesystemencoding())) + + +if __name__ == "__main__": + main() |
