@@ -26,6 +26,11 @@ def is_str(string):
2626 bool: True or False
2727
2828 """
29+ warnings .warn (
30+ "The is_str function is deprecated. \
31+ Use isinstance(string, str) instead." ,
32+ DeprecationWarning )
33+
2934 if sys .version_info [:2 ] >= (3 , 0 ):
3035 return isinstance (string , str )
3136
@@ -50,35 +55,12 @@ def find_xml_generator(name="castxml", search_path=None):
5055
5156 """
5257
53- if sys .version_info [:2 ] >= (3 , 3 ):
54- path = _find_xml_generator_for_python_greater_equals_33 (
55- name , search_path = search_path )
56- else :
57- path = _find_xml_generator_for_legacy_python (name )
58-
58+ path = shutil .which (name , path = search_path )
5959 if path == "" or path is None :
6060 raise Exception ("No c++ parser found. Please install castxml." )
6161 return path .rstrip (), name
6262
6363
64- def _find_xml_generator_for_python_greater_equals_33 (name , search_path = None ):
65- return shutil .which (name , path = search_path )
66-
67-
68- def _find_xml_generator_for_legacy_python (name ):
69- if platform .system () == "Windows" :
70- command = "where"
71- else :
72- command = "which"
73- p = subprocess .Popen ([command , name ], stdout = subprocess .PIPE ,
74- stderr = subprocess .PIPE )
75- path = p .stdout .read ().decode ("utf-8" )
76- p .wait ()
77- p .stdout .close ()
78- p .stderr .close ()
79- return path .rstrip ()
80-
81-
8264def _create_logger_ (name ):
8365 """Implementation detail, creates a logger."""
8466 logger = logging .getLogger (name )
@@ -295,8 +277,12 @@ class cxx_standard(object):
295277 '-std=c++17' : 201703 ,
296278 '-std=gnu++1z' : 201703 ,
297279 '-std=gnu++17' : 201703 ,
298- '-std=c++2a' : float ('inf' ),
299- '-std=gnu++2a' : float ('inf' ),
280+ '-std=c++2a' : 202002 ,
281+ '-std=gnu++2a' : 202002 ,
282+ '-std=c++20' : 202002 ,
283+ '-std=gnu++20' : 202002 ,
284+ '-std=c++23' : float ('inf' ),
285+ '-std=gnu++23' : float ('inf' ),
300286 }
301287
302288 def __init__ (self , cflags ):
0 commit comments