forked from SublimeCodeIntel/SublimeCodeIntel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcElementTree.py
More file actions
37 lines (33 loc) · 1.26 KB
/
cElementTree.py
File metadata and controls
37 lines (33 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import sys
import struct
VERSION = sys.version_info[:2]
PLATFORM = sys.platform
ARCH = 'x%d' % (struct.calcsize('P') * 8)
if VERSION >= (3, 3):
from iElementTree import *
from iElementTree import _patched_for_komodo_
elif VERSION >= (2, 6):
platform = None
try:
from _local_arch.cElementTree import *
platform = "Local arch"
except ImportError:
if PLATFORM == 'darwin':
from _macosx_universal_py26.cElementTree import *
platform = "MacOS X Universal"
elif PLATFORM.startswith('linux'):
if ARCH == 'x64':
from _linux_libcpp6_x86_64_py26.cElementTree import *
platform = "Linux 64 bits"
elif ARCH == 'x32':
from _linux_libcpp6_x86_py26.cElementTree import *
platform = "Linux 32 bits"
elif PLATFORM.startswith('win'):
if ARCH == 'x64':
from _win64_py26.cElementTree import *
platform = "Windows 64 bits"
elif ARCH == 'x32':
from _win32_py26.cElementTree import *
platform = "Windows 32 bits"
if not platform:
raise ImportError("Could not find a suitable cElementTree binary for your platform and architecture.")