sys: various fixes (#3762)

* sys: simplify _getframe

* sys: mark positional-only args

* sys: fix platform availability

* sys: remove settscdump

This function is no longer documented in 3.6 and above (and doesn't
exist on master, was removed in 4fd64b9a6aba9e6e1a5d).
In 3.5 documentation it's mentioned that it's only available if Python
was compiled with a special flag:
https://docs.python.org/3.5/library/sys.html#sys.settscdump

* sys: update whitelists
This commit is contained in:
Shantanu
2020-02-21 20:58:42 -08:00
committed by GitHub
parent daa738f70e
commit 5a2f4c8cde
3 changed files with 9 additions and 23 deletions

View File

@@ -127,7 +127,7 @@ class _version_info(Tuple[int, int, int, str, int]):
serial: int
version_info: _version_info
def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ...
def call_tracing(__func: Callable[..., _T], __args: Any) -> _T: ...
def _clear_type_cache() -> None: ...
def _current_frames() -> Dict[int, Any]: ...
def _debugmallocstats() -> None: ...
@@ -136,14 +136,14 @@ def __excepthook__(type_: Type[BaseException], value: BaseException,
traceback: TracebackType) -> None: ...
def exc_info() -> _OptExcInfo: ...
# sys.exit() accepts an optional argument of anything printable
def exit(arg: object = ...) -> NoReturn: ...
def exit(__status: object = ...) -> NoReturn: ...
def getcheckinterval() -> int: ... # deprecated
def getdefaultencoding() -> str: ...
if sys.platform != 'win32':
# Unix only
def getdlopenflags() -> int: ...
def getfilesystemencoding() -> str: ...
def getrefcount(arg: Any) -> int: ...
def getrefcount(__object: Any) -> int: ...
def getrecursionlimit() -> int: ...
@overload
@@ -153,10 +153,7 @@ def getsizeof(obj: object, default: int) -> int: ...
def getswitchinterval() -> float: ...
@overload
def _getframe() -> FrameType: ...
@overload
def _getframe(depth: int) -> FrameType: ...
def _getframe(__depth: int = ...) -> FrameType: ...
_ProfileFunc = Callable[[FrameType, str, Any], Any]
def getprofile() -> Optional[_ProfileFunc]: ...
@@ -184,7 +181,7 @@ class _WinVersion(Tuple[int, int, int, int,
def getwindowsversion() -> _WinVersion: ... # Windows only
def intern(string: str) -> str: ...
def intern(__string: str) -> str: ...
def is_finalizing() -> bool: ...
@@ -192,11 +189,10 @@ if sys.version_info >= (3, 7):
__breakpointhook__: Any # contains the original value of breakpointhook
def breakpointhook(*args: Any, **kwargs: Any) -> Any: ...
def setcheckinterval(interval: int) -> None: ... # deprecated
def setdlopenflags(n: int) -> None: ... # Linux only
def setrecursionlimit(limit: int) -> None: ...
def setswitchinterval(interval: float) -> None: ...
def settscdump(on_flag: bool) -> None: ...
def setcheckinterval(__n: int) -> None: ... # deprecated
def setdlopenflags(__flags: int) -> None: ... # Linux only
def setrecursionlimit(__limit: int) -> None: ...
def setswitchinterval(__interval: float) -> None: ...
def gettotalrefcount() -> int: ... # Debug builds only

View File

@@ -205,15 +205,6 @@ struct.iter_unpack
struct.unpack
struct.unpack_from
sys.UnraisableHookArgs
sys._getframe
sys.call_tracing
sys.exit
sys.getrefcount
sys.intern
sys.setcheckinterval
sys.setdlopenflags
sys.setrecursionlimit
sys.setswitchinterval
threading.ExceptHookArgs
time.CLOCK_PROF
time.CLOCK_UPTIME

View File

@@ -757,7 +757,6 @@ sys.last_type
sys.last_value
sys.ps1
sys.ps2
sys.settscdump
sys.tracebacklimit
sysconfig.is_python_build
sysconfig.parse_config_h