I did a bit more research.
Something like this should work:
if SubDirname in sys.modules: reload(SubDirname) else: __import__(SubDirname, locals(), globals())
where reload has same conditionals as in your patch, probably extracting it into helper function is good idea.
I did a bit more research.
Something like this should work:
if SubDirname in sys.modules: SubDirname) _(SubDirname, locals(), globals())
reload(
else:
__import_
where reload has same conditionals as in your patch, probably extracting it into helper function is good idea.