-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move external library handling into ext/
With more and more different (external) libraries, the main aardvark.py gets very cluttered. Move the library handling into ext/__init__.py. Signed-off-by: Michael Walle <[email protected]>
- Loading branch information
Showing
2 changed files
with
34 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import sys | ||
|
||
if sys.platform.startswith('linux'): | ||
try: | ||
from .linux32 import aardvark as api | ||
except ImportError: | ||
try: | ||
from .linux64 import aardvark as api | ||
except ImportError: | ||
api = None | ||
elif sys.platform.startswith('win32'): | ||
try: | ||
from .win32 import aardvark as api | ||
except ImportError: | ||
try: | ||
from .win64 import aardvark as api | ||
except ImportError: | ||
api = None | ||
elif sys.platform.startswith('darwin'): | ||
try: | ||
from .osx64 import aardvark as api | ||
except ImportError: | ||
try: | ||
from .osxarm import aardvark as api | ||
except ImportError: | ||
api = None | ||
else: | ||
api = None | ||
|
||
if not api: | ||
raise RuntimeError('Unable to find suitable binary interface. ' | ||
'Unsupported platform?') |