diff options
author | Ryan Petrello <lists@ryanpetrello.com> | 2015-01-12 15:49:07 -0500 |
---|---|---|
committer | Ryan Petrello <lists@ryanpetrello.com> | 2015-01-12 16:16:37 -0500 |
commit | efd3857e39d70d59c2a090a58ded6c1a9b7bb0fc (patch) | |
tree | 25efae36285ebd5737015e4bdef43cb870e18a3b | |
parent | 868c28d031aa29fb1d0238885561b9c42b77bd54 (diff) | |
download | pecan-efd3857e39d70d59c2a090a58ded6c1a9b7bb0fc.tar.gz |
Fix py32 support; importlib.machinery.SourceFileLoader doesn't exist until py33
Change-Id: I78a34016f87d36ed320a0883a740cd4018e42e4b
-rw-r--r-- | pecan/configuration.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pecan/configuration.py b/pecan/configuration.py index 42a9b50..429a760 100644 --- a/pecan/configuration.py +++ b/pecan/configuration.py @@ -1,10 +1,11 @@ import re import inspect import os +import sys import six -if six.PY3: +if sys.version_info > (3, 2): from importlib.machinery import SourceFileLoader else: import imp @@ -165,7 +166,7 @@ def conf_from_file(filepath): # This provides more verbose import-related error reporting than exec() absname, _ = os.path.splitext(abspath) basepath, module_name = absname.rsplit(os.sep, 1) - if six.PY3: + if sys.version_info > (3, 2): SourceFileLoader(module_name, abspath).load_module(module_name) else: imp.load_module( |