Skip to content

Commit

Permalink
Accommodate for __import__ differences.
Browse files Browse the repository at this point in the history
  • Loading branch information
James William Pye committed Aug 27, 2012
1 parent 8e839ab commit 272edfc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions postgresql/types/io/__init__.py
Expand Up @@ -14,6 +14,7 @@
provides an abstraction for quad-word based times used by some configurations of
PostgreSQL.
"""
import sys
from itertools import cycle, chain
from ... import types as pg_types

Expand Down Expand Up @@ -91,8 +92,12 @@
))
)

def load(relmod):
return __import__(__name__ + '.' + relmod, fromlist = True, level = 1)
if sys.version_info[:2] < (3,3):
def load(relmod):
return __import__(__name__ + '.' + relmod, fromlist = True, level = 1)
else:
def load(relmod):
return __import__(relmod, globals = globals(), locals = locals(), fromlist = [''], level = 1)

def resolve(oid):
io = module_io.get(oid)
Expand Down

0 comments on commit 272edfc

Please sign in to comment.