Skip to content
Browse files

require minimum python version

  • Loading branch information...
1 parent c69f8d1 commit 10247867e8bda223341fdbb0d1e16996d8249ff1 @mbdriscoll mbdriscoll committed Mar 20, 2011
Showing with 12 additions and 1 deletion.
  1. +12 −1 console.py
View
13 console.py
@@ -1,4 +1,15 @@
-#!/usr/bin/python2
+#!/usr/bin/env python
+
+# require minimum version
+FBSH_MIN_PYTHON_VERSION = "2.6.0" # major.minor.patchlevel
+class UnsupportedVersionError(EnvironmentError): pass
+try:
+ import platform # added in python2.3
+ if platform.python_version() < FBSH_MIN_PYTHON_VERSION:
+ raise UnsupportedVersionError
+except (UnsupportedVersionError, ImportError):
+ print "Error: fbsh requires python >=", FBSH_MIN_PYTHON_VERSION
+ exit(1)
import atexit, os, readline
import sys, traceback, time

0 comments on commit 1024786

Please sign in to comment.
Something went wrong with that request. Please try again.