[Jython-checkins] jython (2.5): Implementing OS recognition for OS/400: Partially addresses #1842

alan.kennedy jython-checkins at python.org
Sat May 5 17:14:34 CEST 2012


http://hg.python.org/jython/rev/c62b1a8fa99b
changeset:   6648:c62b1a8fa99b
branch:      2.5
parent:      6613:61758cb384eb
user:        Alan Kennedy <alan at xhaus.com>
date:        Sat May 05 16:12:46 2012 +0100
summary:
  Implementing OS recognition for OS/400: Partially addresses #1842

files:
  Lib/os.py                            |  14 ++++++++++++++
  src/org/python/modules/posix/OS.java |   2 ++
  2 files changed, 16 insertions(+), 0 deletions(-)


diff --git a/Lib/os.py b/Lib/os.py
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -114,6 +114,20 @@
     __all__.extend(_get_exports_list(riscos))
     del riscos
 
+elif 'ibmi' in _names:
+    _name = 'ibmi'
+    linesep = '\n'
+    from ibmi import *
+    try:
+        from ibmi import _exit
+    except ImportError:
+        pass
+    import posixpath as path
+
+    import ibmi
+    __all__.extend(_get_exports_list(ibmi))
+    del ibmi
+
 else:
     raise ImportError, 'no os specific module found'
 
diff --git a/src/org/python/modules/posix/OS.java b/src/org/python/modules/posix/OS.java
--- a/src/org/python/modules/posix/OS.java
+++ b/src/org/python/modules/posix/OS.java
@@ -9,6 +9,8 @@
  */
 enum OS {
     NT("Windows", new String[] {"cmd.exe", "/c"}, new String[] {"command.com", "/c"}),
+    // http://bugs.jython.org/issue1842
+    IBMi("OS/400", new String[] {"/QOpenSys/usr/bin/sh", "-c"}),
     POSIX(new String[] {"/bin/sh", "-c"});
 
     /** An array of potential shell commands this platform may use. */

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list