Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

require minimum python version

  • Loading branch information...
commit 10247867e8bda223341fdbb0d1e16996d8249ff1 1 parent c69f8d1
@mbdriscoll mbdriscoll authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.