Skip to content

Instantly share code, notes, and snippets.

@takluyver
Created September 25, 2014 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takluyver/ac036f733c6f79342780 to your computer and use it in GitHub Desktop.
Save takluyver/ac036f733c6f79342780 to your computer and use it in GitHub Desktop.
osgeo/__init__.py modification
# __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