diff options
| author | rajdakin <rajdakin@gmail.com> | 2023-02-12 21:51:11 +0100 |
|---|---|---|
| committer | rajdakin <rajdakin@gmail.com> | 2023-02-12 21:51:11 +0100 |
| commit | a65bf79ad94babab7f132ed6b8674f9f490bc4a0 (patch) | |
| tree | a1310875fb3590f5a572b7a0df31fd56a457766d | |
| parent | c192188b4218ebba271bfd4734e38ae55b69b6b1 (diff) | |
| download | box64-a65bf79ad94babab7f132ed6b8674f9f490bc4a0.tar.gz box64-a65bf79ad94babab7f132ed6b8674f9f490bc4a0.zip | |
[WRAPPERS] Forgot to remove typing multiple definition comments
| -rwxr-xr-x | rebuild_wrappers.py | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/rebuild_wrappers.py b/rebuild_wrappers.py index 0a1c0c76..edd40ec6 100755 --- a/rebuild_wrappers.py +++ b/rebuild_wrappers.py @@ -3,46 +3,45 @@ import os import sys -# TODO: remove these comments try: - #assert(sys.version_info.major == 3) - #if sys.version_info.minor >= 9: + assert(sys.version_info.major == 3) + if sys.version_info.minor >= 9: # Python 3.9+ from typing import Generic, NewType, Optional, TypeVar, Union, final from collections.abc import Iterable Dict = dict List = list Tuple = tuple - #elif sys.version_info.minor >= 8: - # # Python [3.8, 3.9) - # from typing import Dict, List, Tuple, Generic, Iterable, NewType, Optional, TypeVar, Union, final - #elif (sys.version_info.minor >= 5) and (sys.version_info.micro >= 2): - # # Python [3.5.2, 3.8) - # from typing import Dict, List, Tuple, Generic, Iterable, NewType, Optional, TypeVar, Union - # final = lambda fun: fun # type: ignore - #elif sys.version_info.minor >= 5: - # # Python [3.5, 3.5.2) - # from typing import Dict, List, Tuple, Generic, Iterable, Optional, TypeVar, Union - # class GTDummy: - # def __getitem__(self, _): return self - # final = lambda fun: fun # type: ignore - # def NewType(_, b): return b # type: ignore - #else: - # # Python < 3.5 - # #print("Your Python version does not have the typing module, fallback to empty 'types'") - # # Dummies - # class GTDummy: - # def __getitem__(self, _): - # return self - # Dict = GTDummy() # type: ignore - # List = GTDummy() # type: ignore - # Generic = GTDummy() # type: ignore - # Iterable = GTDummy() # type: ignore - # Optional = GTDummy() # type: ignore - # def NewType(_, b): return b # type: ignore - # Tuple = GTDummy() # type: ignore - # def TypeVar(T): return object # type: ignore - # Union = GTDummy() # type: ignore + elif sys.version_info.minor >= 8: + # Python [3.8, 3.9) + from typing import Dict, List, Tuple, Generic, Iterable, NewType, Optional, TypeVar, Union, final + elif (sys.version_info.minor >= 5) and (sys.version_info.micro >= 2): + # Python [3.5.2, 3.8) + from typing import Dict, List, Tuple, Generic, Iterable, NewType, Optional, TypeVar, Union + final = lambda fun: fun # type: ignore + elif sys.version_info.minor >= 5: + # Python [3.5, 3.5.2) + from typing import Dict, List, Tuple, Generic, Iterable, Optional, TypeVar, Union + class GTDummy: + def __getitem__(self, _): return self + final = lambda fun: fun # type: ignore + def NewType(_, b): return b # type: ignore + else: + # Python < 3.5 + #print("Your Python version does not have the typing module, fallback to empty 'types'") + # Dummies + class GTDummy: + def __getitem__(self, _): + return self + Dict = GTDummy() # type: ignore + List = GTDummy() # type: ignore + Generic = GTDummy() # type: ignore + Iterable = GTDummy() # type: ignore + Optional = GTDummy() # type: ignore + def NewType(_, b): return b # type: ignore + Tuple = GTDummy() # type: ignore + def TypeVar(T): return object # type: ignore + Union = GTDummy() # type: ignore except ImportError: print("It seems your Python version is quite broken...") assert(False) |