Created
September 25, 2014 01:13
-
-
Save takluyver/ac036f733c6f79342780 to your computer and use it in GitHub Desktop.
osgeo/__init__.py modification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# __init__ for osgeo package. | |
# making the osgeo package version the same as the gdal version: | |
from sys import version_info | |
if version_info >= (2,6,0): | |
def swig_import_helper(): | |
from os.path import dirname | |
import imp | |
fp = None | |
try: | |
fp, pathname, description = imp.find_module('_gdal', [dirname(__file__)]) | |
except ImportError: | |
from . import _gdal # I added 'from .' here | |
return _gdal | |
if fp is not None: | |
try: | |
_mod = imp.load_module('_gdal', fp, pathname, description) | |
finally: | |
fp.close() | |
return _mod | |
_gdal = swig_import_helper() | |
del swig_import_helper | |
else: | |
import _gdal | |
__version__ = _gdal.__version__ = _gdal.VersionInfo("RELEASE_NAME") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment