#!/usr/bin/env python 
#portable serial port access with python
#this is a wrapper module for different platform implementations
#
# (C)2001-2002 Chris Liechti <cliechti@gmx.net>
# this is distributed under a free software license, see license.txt

VERSION = '2.4'

import sys

try:
    import os
except ImportError:
    if sys.name == 'cli':
        from serialcli import *
    else:
        raise Exception("Sorry: no implementation for your platform ('%s') available" % os.name)
else:
    #chose an implementation, depending on os
    if os.name == 'nt': #sys.platform == 'win32':
        from serialwin32 import *
    elif os.name == 'posix':
        from serialposix import *
    elif os.name == 'java':
        from serialjava import *
    else:
        raise Exception("Sorry: no implementation for your platform ('%s') available" % os.name)


@@ -275,62 +275,23 @@
 ys%0A%0A
-try:%0A    import os%0Aexcept ImportError:%0A    if sys.name
+if sys.platform
  == 
@@ -297,20 +297,16 @@
  'cli':%0A
-    
     from
@@ -317,36 +317,32 @@
 ialcli import *%0A
-    
 else:%0A        ra
@@ -339,106 +339,17 @@
     
-    raise Exception(%22Sorry: no implementation for your platform ('%25s') available%22 %25 os.name)%0Aelse:
+import os
 %0A   

improve OS detection for IronPython