diff options
| author | Andrew Lamoureux <andrew@vector35.com> | 2019-03-19 17:32:44 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2019-03-20 13:00:17 -0400 |
| commit | 24ead55316ac8497df5842caf4e1d51f2b799787 (patch) | |
| tree | 3dfdfae8a076445c9d24bf6d1b40e57f36ebf94a /python/examples/kaitai/__init__.py | |
| parent | 411acbaa4a1d217e731d3df0b189445117be3b26 (diff) | |
kaitai: adjustments and rearrangements for python2/3 compat
Diffstat (limited to 'python/examples/kaitai/__init__.py')
| -rw-r--r-- | python/examples/kaitai/__init__.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/python/examples/kaitai/__init__.py b/python/examples/kaitai/__init__.py index 90cdbd77..7ac825d2 100644 --- a/python/examples/kaitai/__init__.py +++ b/python/examples/kaitai/__init__.py @@ -1 +1,14 @@ -from . import view +import sys + +# invoked from python2 command line? (eg: python -m kaitai ...) +if sys.version_info[0] == 2 and sys.argv[0:] and sys.argv[0]=='-c': + pass +# invoked from python3 command line? (eg: python -m kaitai ...) +elif sys.version_info[0] == 3 and sys.argv[0:] and sys.argv[0]=='-m': + pass +# invoked from binja +else: + if sys.version_info[0] == 2: + import view + else: + from . import view |
