Michael Felt <aixto...@felt.demon.nl> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36624>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to