Replace os.name with sys.platform calls