[gobject-introspection] chose extension basing on OS
- From: Johan Dahlin <johan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] chose extension basing on OS
- Date: Wed, 6 Oct 2010 12:37:19 +0000 (UTC)
commit 272c4dbdf66eadfde8bf18200826867ec3a74035
Author: Alexey Zakhlestin <indeyets gmail com>
Date: Wed Oct 6 15:02:46 2010 +0400
chose extension basing on OS
https://bugzilla.gnome.org/show_bug.cgi?id=606686
giscanner/libtoolimporter.py | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/libtoolimporter.py b/giscanner/libtoolimporter.py
index e149ec4..84c62f9 100644
--- a/giscanner/libtoolimporter.py
+++ b/giscanner/libtoolimporter.py
@@ -20,6 +20,7 @@
import imp
import os
+import platform
import sys
from .utils import extract_libtool
@@ -49,8 +50,16 @@ class LibtoolImporter(object):
def load_module(self, name):
realpath = extract_libtool(self.path)
- mod = imp.load_module(name, open(realpath), realpath,
- ('.so', 'rb', 3))
+ platform_system = platform.system()
+
+ if platform_system == 'Darwin':
+ extension = '.dylib'
+ elif platform_system == 'Windows':
+ extension = '.dll'
+ else:
+ extension = '.so'
+
+ mod = imp.load_module(name, open(realpath), realpath, (extension, 'rb', 3))
mod.__loader__ = self
return mod
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]