[27531] in Source-Commits

home help back first fref pref prev next nref lref last post

python-afs commit: Drop support for python < 2.6

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue Nov 12 18:27:57 2013

Date: Tue, 12 Nov 2013 18:27:51 -0500
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201311122327.rACNRpoF018780@drugstore.mit.edu>
To: source-commits@MIT.EDU

https://github.com/mit-athena/python-afs/commits/7b37633dbda915b00b241b18ba24b43c89fe2879
commit 7b37633dbda915b00b241b18ba24b43c89fe2879
Author: Jonathan Reed <jdreed@mit.edu>
Date:   Fri Nov 1 14:25:40 2013 -0400

    Drop support for python < 2.6
    
    Require Python 2.6 in setup.py and remove the last vestiges of 2.5
    exception syntax.

 afs/fs.py |    2 +-
 setup.py  |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/afs/fs.py b/afs/fs.py
index ca53a30..4d254b6 100644
--- a/afs/fs.py
+++ b/afs/fs.py
@@ -36,7 +36,7 @@ def inafs(path):
     """Return True if a path is in AFS."""
     try:
         _fs.whichcell(path)
-    except OSError, e:
+    except OSError as e:
         if e.errno in (errno.EINVAL, errno.ENOENT):
             return False
 
diff --git a/setup.py b/setup.py
index 1f28113..fe9b865 100755
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,12 @@
 #!/usr/bin/python
 
+import sys
+if sys.hexversion < 0x020600f0:
+    sys.exit("Python 2.6 or higher is required.")
+
 from distutils.core import setup
 from distutils.extension import Extension
 from Cython.Distutils import build_ext
-import sys
 import os
 
 for root in ['/Library/OpenAFS/Tools',

home help back first fref pref prev next nref lref last post