info.py 355 B

1234567891011121314151617
  1. import sys
  2. import platform
  3. WINDOWS = platform.system().lower() == "windows"
  4. PY2 = sys.version_info.major < 3
  5. def check_Windows():
  6. current_platform = platform.system()
  7. if not WINDOWS:
  8. raise RuntimeError("available only for Windows, not {}.".format(current_platform))
  9. def check_PY2():
  10. if not PY2:
  11. raise RuntimeError("needed only in Python 2")