Fix zLinux (OS system Z) support

Issue #2 resolved
Albert-Jan Roskam repo owner created an issue

zLinux should be supported but I don't know how to tell this system apart from other Linux systems. Using sys.platform is not enough, probably. Please email me if you know more about this: "@".join(["fomcl", "yahoo" + "." + "com"])

Comments (2)

  1. Albert-Jan Roskam reporter

    Anderson P. from System z Linux LinkedIn group kindly helped me with this. Tested with Linux on System z virtual machine running RHEL 5.6 under z/VM, using Python 2.4.3 (#1, Dec 10 2010, 17:28:02), the result was "Linux, 64bit, s390x"

    [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
    >>> import sys, platform, os
    >>> print platform.system()
    Linux
    >>> print platform.architecture()
    ('64bit', 'ELF')
    >>> print os.uname()
    ('Linux', 'SCCD01.zcenter.spo.ihost.com', '2.6.18-238.el5', '#1 SMP Sun Dec 19 14:27:28 EST 2010', 's390x') 
    # Consider s390 for the 31-bit architecture and s390x for 64bits. 
    # Note that the SPSS I/O libraries are for a 64-bit architecture
    # Therefore, the following one-liner should do the trick:
    is_zLinux =  sys.platform.lower().startswith("lin") and is_64bit and os.uname()[-1] == "s390x"
    
  2. Albert-Jan Roskam reporter

    System z Linux can be recognized like this:

    is_zLinux =  sys.platform.lower().startswith("lin") and is_64bit and os.uname()[-1] == "s390x"
    
  3. Log in to comment