Python 2.6 compatability via ericfrederich's patch. DRY version-checking code

This commit is contained in:
rocky
2015-12-17 20:48:54 -05:00
parent a309a77ea7
commit 2fc2d6c699
14 changed files with 72 additions and 56 deletions

View File

@@ -18,13 +18,15 @@ want to run on Python 2.7.
from __future__ import print_function
import importlib, inspect, os, sys
import inspect, os, sys
import uncompyle6
from uncompyle6.scanner import get_scanner
def check_object_path(path):
if path.endswith(".py"):
if uncompyle6.PYTHON3:
import importlib
path = importlib.util.cache_from_source(path)
return path
if not path.endswith(".pyc") and not path.endswith(".pyo"):