bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)

* Add support.MS_WINDOWS: True if Python is running on Microsoft Windows.
* Add support.MACOS: True if Python is running on Apple macOS.
* Replace support.is_android with support.ANDROID
* Replace support.is_jython with support.JYTHON
* Cleanup code to initialize unix_shell
This commit is contained in:
Victor Stinner 2018-06-22 19:25:44 +02:00 committed by GitHub
parent 209abf7469
commit 8fbbdf0c31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 95 additions and 91 deletions

View file

@ -3,12 +3,12 @@
Nick Mathewson
"""
import unittest
from test.support import is_jython
from test import support
from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT
import io
if is_jython:
if support.JYTHON:
import sys
def unify_callables(d):
@ -21,7 +21,7 @@ class CodeopTests(unittest.TestCase):
def assertValid(self, str, symbol='single'):
'''succeed iff str is a valid piece of code'''
if is_jython:
if support.JYTHON:
code = compile_command(str, "<input>", symbol)
self.assertTrue(code)
if symbol == "single":
@ -60,7 +60,7 @@ class CodeopTests(unittest.TestCase):
av = self.assertValid
# special case
if not is_jython:
if not support.JYTHON:
self.assertEqual(compile_command(""),
compile("pass", "<input>", 'single',
PyCF_DONT_IMPLY_DEDENT))