Enforce the use of python3 when running this script

This commit is contained in:
nvanschoote 2019-07-12 10:24:32 +02:00
parent 8d8e3f3e50
commit fa4dddd153

View File

@ -2,15 +2,18 @@
# encoding: utf-8 # encoding: utf-8
from pkg_resources import parse_version from pkg_resources import parse_version
import sys import sys
if sys.version_info[0] < 3:
print('This tool works with Python3. Not Python 2')
sys.exit(1)
try: try:
import kopano import kopano
except ImportError: except ImportError:
print('python-kopano should be installed on your system') print('python3-kopano should be installed on your system')
sys.exit(1) sys.exit(1)
try: try:
from MAPI.Util import * from MAPI.Util import *
except ImportError: except ImportError:
print('python-mapi should be installed on your system') print('python3-mapi should be installed on your system')
sys.exit(1) sys.exit(1)
import json import json
import base64 import base64