Skip to content

Commit 558c1cd

Browse files
BCSharpslozier
authored andcommitted
Enable testing with CPython on Linux (#699)
1 parent 5870a46 commit 558c1cd

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,7 @@ launchSettings.json
102102
*.o
103103
/Src/ctypes_test/*.pyd
104104
/Src/ctypes_test/*.pyd
105-
/Src/StdLib/Lib/__pycache__
105+
/Src/StdLib/Lib/**/__pycache__
106+
/Src/IronPython/Lib/**/__pycache__
107+
/Tests/**/__pycache__
106108
/Tests/modules/misc/test_data.gz

Src/IronPython/Lib/iptest/test_env.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
is_cli = sys.implementation.name == 'ironpython'
1212
is_ironpython = is_cli
1313
is_cpython = not is_ironpython
14-
is_posix = sys.platform == 'posix'
14+
is_windows = sys.platform == 'win32'
15+
is_posix = sys.platform == 'posix' or sys.platform == 'linux'
1516
is_osx = sys.platform == 'darwin'
1617
is_netcoreapp = False
1718
is_netcoreapp21 = False
@@ -38,12 +39,9 @@
3839

3940
is_32, is_64 = is_cli32, is_cli64
4041
if not is_ironpython:
41-
cpu = os.environ["PROCESSOR_ARCHITECTURE"]
42-
if cpu.lower()=="x86":
43-
is_32 = True
44-
elif cpu.lower()=="amd64":
45-
is_64 = True
46-
42+
import struct
43+
ptr_size = struct.calcsize('P')
44+
is_32, is_64 = (ptr_size == 4), (ptr_size == 8)
4745

4846
#--CLR version we're running on (if any)
4947

0 commit comments

Comments
 (0)