[EMAIL PROTECTED] wrote:
    >> # Ensure that we're running Python 3 or later.
    >> import sys
    >> assert int(sys.version.split()[0].split('.')[0]) >= 3
    >> # If there's a better way to chek, please tell.
[...]

Why split at all?  Just use sys.version_info:

    >>> import sys
    >>> assert sys.version_info[0] > 2, sys.version_info
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    AssertionError: (2, 4, 5, 'final', 0)

Thanks. Yes, that's better.

To verify that the running version of Python is 3 or higher,

   import sys
   assert sys.version_info[0] >= 3


--
--Bryan
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to