python: Issue #13 skipping building extensions on non-Linux platforms
diff --git a/libkmod/python/kmod/__init__.py b/libkmod/python/kmod/__init__.py
index 20a73ef..0d79787 100644
--- a/libkmod/python/kmod/__init__.py
+++ b/libkmod/python/kmod/__init__.py
@@ -17,4 +17,8 @@
 "Libkmod -- Python interface to kmod API."
 
 from .version import __version__
-from .kmod import Kmod
+try:
+    from .kmod import Kmod
+except ImportError:
+    # this is a non-Linux platform
+    pass
diff --git a/libkmod/python/setup.py b/libkmod/python/setup.py
index 2a63b4b..090e5d5 100644
--- a/libkmod/python/setup.py
+++ b/libkmod/python/setup.py
@@ -19,6 +19,7 @@
 from distutils.extension import Extension as _Extension
 import os as _os
 import sys as _sys
+import platform
 
 from Cython.Distutils import build_ext as _build_ext
 
@@ -34,15 +35,16 @@
 _this_dir = _os.path.dirname(__file__)
 
 ext_modules = []
-for filename in sorted(_os.listdir(package_name)):
-    basename,extension = _os.path.splitext(filename)
-    if extension == '.pyx':
-        ext_modules.append(
-            _Extension(
-                '{0}.{1}'.format(package_name, basename),
-                [_os.path.join(package_name, filename)],
-                libraries=['kmod'],
-                ))
+if platform.system() == "Linux":
+    for filename in sorted(_os.listdir(package_name)):
+        basename,extension = _os.path.splitext(filename)
+        if extension == '.pyx':
+            ext_modules.append(
+                _Extension(
+                    '{0}.{1}'.format(package_name, basename),
+                    [_os.path.join(package_name, filename)],
+                    libraries=['kmod'],
+                    ))
 
 setup(
     name=package_name,