File tree Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
22from __future__ import print_function
33
4- import sys
5- import pkg_resources
6- import compas
4+ import platform
5+
6+ try :
7+ import pkg_resources
8+ except ImportError :
9+ pkg_resources = None
710
11+ import compas
812
913if __name__ == '__main__' :
1014
1923 print ('Yay! COMPAS is installed correctly!' )
2024 print ()
2125 print ('COMPAS: {}' .format (compas .__version__ ))
22- print ('Python: {}' .format (str ( sys . version )))
26+ print ('Python: {} ({}) ' .format (platform . python_version (), platform . python_implementation ( )))
2327
24- working_set = pkg_resources .working_set
25- packages = set ([p .project_name for p in working_set ]) - set (['COMPAS' ])
26- compas_pkgs = [p for p in packages if p .lower ().startswith ('compas' )]
28+ if pkg_resources :
29+ working_set = pkg_resources .working_set
30+ packages = set ([p .project_name for p in working_set ]) - set (['COMPAS' ])
31+ compas_pkgs = [p for p in packages if p .lower ().startswith ('compas' )]
2732
28- if compas_pkgs :
29- print ('Extensions: {}' .format ([p for p in compas_pkgs ]))
33+ if compas_pkgs :
34+ print ('Extensions: {}' .format ([p for p in compas_pkgs ]))
Original file line number Diff line number Diff line change 44Not intended to be used outside compas* packages.
55"""
66import os
7+ import platform
78import re
8- import tempfile
99import shutil
1010import subprocess
1111import sys
12+ import tempfile
1213
1314try :
1415 NotADirectoryError
@@ -96,7 +97,7 @@ def is_ironpython():
9697 True if the implementation is IronPython. False otherwise
9798
9899 """
99- return 'ironpython' in sys . version .lower ()
100+ return 'ironpython' == platform . python_implementation () .lower ()
100101
101102
102103def is_rhino ():
Original file line number Diff line number Diff line change 33from __future__ import division
44
55import json
6- import sys
6+ import platform
77
88from compas .data .exceptions import DecoderError
99
1010# We don't do this from `compas.IPY` to avoid circular imports
11- if 'ironpython' in sys . version .lower ():
11+ if 'ironpython' == platform . python_implementation () .lower ():
1212 try :
1313 from System .Collections .Generic import IDictionary
1414 except : # noqa: E722
You can’t perform that action at this time.
0 commit comments