Wish - version check/warning

0 views
Skip to first unread message

Olof Bjarnason

unread,
Sep 13, 2012, 4:17:32 AM9/13/12
to pytd...@googlegroups.com
Wouldn't it be really nice if pytddmon told the user if he is running pytddmon under a non-supported Python version?

Graceful version is just printing a warning message on boot, if it's not Python 2.7 or 3.2 environment.

More robust version would be to exit the script if wrong version, with a reason and howto get around. Something like "You are running on a non-supported Python version. To run pytddmon anyway, add --ignore-python-version to the command line".

Any takers?

Olof Bjarnason

unread,
Sep 13, 2012, 4:18:03 AM9/13/12
to pytd...@googlegroups.com
I just did this check in another project, here's the essential code snippet:

  import sys
  (major, minor) = sys.version_info[:2]
  if major<>2 or minor<>7:
    # do something

2012/9/13 Olof Bjarnason <olof.bj...@gmail.com>
Reply all
Reply to author
Forward
0 new messages