Skip to content

Commit

Permalink
Handle __import__ statement
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmoore committed Sep 11, 2019
1 parent 3e17e99 commit 959344a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/unit/clitest/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@
import uuid
from omero.cli import CLI, NonZeroReturnCode
# Workaround for a poorly named module
plugin = __import__('omero.plugins.import', globals(), locals(),
['ImportControl'], -1)
try:
plugin = __import__('omero.plugins.import', globals(), locals(),
['ImportControl'], -1)
except ValueError:
# Python 3
plugin = __import__('omero.plugins.import', globals(), locals(),
['ImportControl'], 0)

ImportControl = plugin.ImportControl
CommandArguments = plugin.CommandArguments

Expand Down

0 comments on commit 959344a

Please sign in to comment.