This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Michael.Felt
Recipients Michael.Felt, vstinner
Date 2019-04-14.20:32:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <7cc843d2-13c2-46e7-56b0-cdad76266743@felt.demon.nl>
In-reply-to <1555257880.16.0.504596384662.issue36624@roundup.psfhosted.org>
Content
On 14/04/2019 18:04, Michael Felt wrote:
> Is this a good way to get started?

So, as an example - seems to be many attributes in test/support/__init__.py

diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 5bd15a2..e20567f 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -101,6 +101,8 @@ __all__ = [
     # network
     "HOST", "IPV6_ENABLED", "find_unused_port", "bind_port",
"open_urlresource",
     "bind_unix_socket",
+    # platform
+    "is_aix",
     # processes
     'temp_umask', "reap_children",
     # logging
@@ -815,6 +817,7 @@ requires_bz2 = unittest.skipUnless(bz2, 'requires bz2')
 requires_lzma = unittest.skipUnless(lzma, 'requires lzma')

 is_jython = sys.platform.startswith('java')
+is_aix = platform.system() == 'AIX'

 is_android = hasattr(sys, 'getandroidapilevel')

diff --git a/Lib/test/test_c_locale_coercion.py
b/Lib/test/test_c_locale_coercion.py
index 35272b5..0685ed8 100644
--- a/Lib/test/test_c_locale_coercion.py
+++ b/Lib/test/test_c_locale_coercion.py
@@ -10,6 +10,7 @@ import unittest
 from collections import namedtuple

 from test import support
+is_aix = support.is_aix
 from test.support.script_helper import (
     run_python_until_end,
     interpreter_requires_environment,
@@ -40,7 +41,7 @@ if sys.platform.startswith("linux"):
         # TODO: Once https://bugs.python.org/issue30672 is addressed,
we'll be
         #       able to check this case unconditionally
         EXPECTED_C_LOCALE_EQUIVALENTS.append("POSIX")
-elif sys.platform.startswith("aix"):
+elif is_aix:
     # AIX uses iso8859-1 in the C locale, other *nix platforms use ASCII
     EXPECTED_C_LOCALE_STREAM_ENCODING = "iso8859-1"
     EXPECTED_C_LOCALE_FS_ENCODING = "iso8859-1"

I had originally been thinking using _AIX, but the convention seems to
be is_xyzsomething.

Comments welcome.
History
Date User Action Args
2019-04-14 20:32:05Michael.Feltsetrecipients: + Michael.Felt, vstinner
2019-04-14 20:32:05Michael.Feltlinkissue36624 messages
2019-04-14 20:32:05Michael.Feltcreate