| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1040,20 +1040,6 @@ def processor(): | |||
| 1040 | 1040 | r'(?:,\s*([\w :]*))?)?\)\s*' # ", buildtime)<space>" | |
| 1041 | 1041 | r'\[([^\]]+)\]?', re.ASCII) # "[compiler]" | |
| 1042 | 1042 | ||
| 1043 | - _ironpython_sys_version_parser = re.compile( | ||
| 1044 | - r'IronPython\s*' | ||
| 1045 | - r'([\d\.]+)' | ||
| 1046 | - r'(?: \(([\d\.]+)\))?' | ||
| 1047 | - r' on (.NET [\d\.]+)', re.ASCII) | ||
| 1048 | - | ||
| 1049 | - # IronPython covering 2.6 and 2.7 | ||
| 1050 | - _ironpython26_sys_version_parser = re.compile( | ||
| 1051 | - r'([\d.]+)\s*' | ||
| 1052 | - r'\(IronPython\s*' | ||
| 1053 | - r'[\d.]+\s*' | ||
| 1054 | - r'\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)' | ||
| 1055 | - ) | ||
| 1056 | - | ||
| 1057 | 1043 | _pypy_sys_version_parser = re.compile( | |
| 1058 | 1044 | r'([\w.+]+)\s*' | |
| 1059 | 1045 | r'\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*' | |
@@ -1090,25 +1076,7 @@ def _sys_version(sys_version=None): | |||
| 1090 | 1076 | if result is not None: | |
| 1091 | 1077 | return result | |
| 1092 | 1078 | ||
| 1093 | - # Parse it | ||
| 1094 | - if 'IronPython' in sys_version: | ||
| 1095 | - # IronPython | ||
| 1096 | - name = 'IronPython' | ||
| 1097 | - if sys_version.startswith('IronPython'): | ||
| 1098 | - match = _ironpython_sys_version_parser.match(sys_version) | ||
| 1099 | - else: | ||
| 1100 | - match = _ironpython26_sys_version_parser.match(sys_version) | ||
| 1101 | - | ||
| 1102 | - if match is None: | ||
| 1103 | - raise ValueError( | ||
| 1104 | - 'failed to parse IronPython sys.version: %s' % | ||
| 1105 | - repr(sys_version)) | ||
| 1106 | - | ||
| 1107 | - version, alt_version, compiler = match.groups() | ||
| 1108 | - buildno = '' | ||
| 1109 | - builddate = '' | ||
| 1110 | - | ||
| 1111 | - elif sys.platform.startswith('java'): | ||
| 1079 | + if sys.platform.startswith('java'): | ||
| 1112 | 1080 | # Jython | |
| 1113 | 1081 | name = 'Jython' | |
| 1114 | 1082 | match = _sys_version_parser.match(sys_version) | |
@@ -1171,7 +1139,6 @@ def python_implementation(): | |||
| 1171 | 1139 | ||
| 1172 | 1140 | Currently, the following implementations are identified: | |
| 1173 | 1141 | 'CPython' (C implementation of Python), | |
| 1174 | - 'IronPython' (.NET implementation of Python), | ||
| 1175 | 1142 | 'Jython' (Java implementation of Python), | |
| 1176 | 1143 | 'PyPy' (Python implementation of Python). | |
| 1177 | 1144 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -123,10 +123,6 @@ def test_sys_version(self): | |||
| 123 | 123 | for input, output in ( | |
| 124 | 124 | ('2.4.3 (#1, Jun 21 2006, 13:54:21) \n[GCC 3.3.4 (pre 3.3.5 20040809)]', | |
| 125 | 125 | ('CPython', '2.4.3', '', '', '1', 'Jun 21 2006 13:54:21', 'GCC 3.3.4 (pre 3.3.5 20040809)')), | |
| 126 | - ('IronPython 1.0.60816 on .NET 2.0.50727.42', | ||
| 127 | - ('IronPython', '1.0.60816', '', '', '', '', '.NET 2.0.50727.42')), | ||
| 128 | - ('IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42', | ||
| 129 | - ('IronPython', '1.0.0', '', '', '', '', '.NET 2.0.50727.42')), | ||
| 130 | 126 | ('2.4.3 (truncation, date, t) \n[GCC]', | |
| 131 | 127 | ('CPython', '2.4.3', '', '', 'truncation', 'date t', 'GCC')), | |
| 132 | 128 | ('2.4.3 (truncation, date, ) \n[GCC]', | |
@@ -161,20 +157,11 @@ def test_sys_version(self): | |||
| 161 | 157 | ('r261:67515', 'Dec 6 2008 15:26:00'), | |
| 162 | 158 | 'GCC 4.0.1 (Apple Computer, Inc. build 5370)'), | |
| 163 | 159 | ||
| 164 | - ("IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053", None, "cli") | ||
| 160 | + ("3.10.8 (tags/v3.10.8:aaaf517424, Feb 14 2023, 16:28:12) [GCC 9.4.0]", | ||
| 161 | + None, "linux") | ||
| 165 | 162 | : | |
| 166 | - ("IronPython", "2.0.0", "", "", ("", ""), | ||
| 167 | - ".NET 2.0.50727.3053"), | ||
| 168 | - | ||
| 169 | - ("2.6.1 (IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433)", None, "cli") | ||
| 170 | - : | ||
| 171 | - ("IronPython", "2.6.1", "", "", ("", ""), | ||
| 172 | - ".NET 2.0.50727.1433"), | ||
| 173 | - | ||
| 174 | - ("2.7.4 (IronPython 2.7.4 (2.7.0.40) on Mono 4.0.30319.1 (32-bit))", None, "cli") | ||
| 175 | - : | ||
| 176 | - ("IronPython", "2.7.4", "", "", ("", ""), | ||
| 177 | - "Mono 4.0.30319.1 (32-bit)"), | ||
| 163 | + ('CPython', '3.10.8', '', '', | ||
| 164 | + ('tags/v3.10.8:aaaf517424', 'Feb 14 2023 16:28:12'), 'GCC 9.4.0'), | ||
| 178 | 165 | ||
| 179 | 166 | ("2.5 (trunk:6107, Mar 26 2009, 13:02:18) \n[Java HotSpot(TM) Client VM (\"Apple Computer, Inc.\")]", | |
| 180 | 167 | ('Jython', 'trunk', '6107'), "java1.5.0_16") | |
@@ -205,6 +192,9 @@ def test_sys_version(self): | |||
| 205 | 192 | self.assertEqual(platform.python_build(), info[4]) | |
| 206 | 193 | self.assertEqual(platform.python_compiler(), info[5]) | |
| 207 | 194 | ||
| 195 | + with self.assertRaises(ValueError): | ||
| 196 | + platform._sys_version('2. 4.3 (truncation) \n[GCC]') | ||
| 197 | + | ||
| 208 | 198 | def test_system_alias(self): | |
| 209 | 199 | res = platform.system_alias( | |
| 210 | 200 | platform.system(), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + Improve import time of ``platform`` by removing IronPython version parsing. The IronPython version parsing | ||
| 2 | + was not functional (see https://github.com/IronLanguages/ironpython3/issues/1667). | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments