diff options
| author | Armin Ronacher <armin.ronacher@active-4.com> | 2014-06-10 13:12:38 +0600 |
|---|---|---|
| committer | Armin Ronacher <armin.ronacher@active-4.com> | 2014-06-10 13:12:38 +0600 |
| commit | 2b08764844db45d531d400ca4d76af5f91ef3a3f (patch) | |
| tree | 262122615aaf3b241708aedaa97e471a9ca5ba47 /examples/complex | |
| parent | 13aa9c53485e53032c658aa47fa7c834cceaa5c7 (diff) | |
| download | click-2b08764844db45d531d400ca4d76af5f91ef3a3f.tar.gz | |
Fixed complex example for Python 3. This fixes #142
Diffstat (limited to 'examples/complex')
| -rw-r--r-- | examples/complex/complex/cli.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/complex/complex/cli.py b/examples/complex/complex/cli.py index 2f515ab..bcfd14a 100644 --- a/examples/complex/complex/cli.py +++ b/examples/complex/complex/cli.py @@ -42,8 +42,9 @@ class ComplexCLI(click.MultiCommand): def get_command(self, ctx, name): try: - mod = __import__('complex.commands.cmd_' + - name.encode('ascii', 'replace'), + if sys.version_info[0] == 2: + name = name.encode('ascii', 'replace') + mod = __import__('complex.commands.cmd_' + name, None, None, ['cli']) except ImportError: return |
