From 2f59de4713ff783b81793f9b41e20117b4f1d602 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Mon, 18 Apr 2016 18:41:38 +0200 Subject: [PATCH] Change logging signatures to allow unicode (#150) --- stdlib/2.7/logging/__init__.pyi | 48 ++++++++++++++++----------------- stdlib/2.7/subprocess.pyi | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/stdlib/2.7/logging/__init__.pyi b/stdlib/2.7/logging/__init__.pyi index e4489d13a..377e800c2 100644 --- a/stdlib/2.7/logging/__init__.pyi +++ b/stdlib/2.7/logging/__init__.pyi @@ -2,7 +2,7 @@ # # NOTE: This dynamically typed stub was automatically generated by stubgen. -from typing import Any, Dict, Optional, Sequence, Tuple, overload +from typing import Any, Dict, Optional, Sequence, Tuple, overload, Union CRITICAL = 0 FATAL = 0 @@ -170,15 +170,15 @@ class Logger(Filterer): disabled = ... # type: Any def __init__(self, name: str, level: int = ...) -> None: ... def setLevel(self, level: int) -> None: ... - def debug(self, msg: str, *args, **kwargs) -> None: ... - def info(self, msg: str, *args, **kwargs) -> None: ... - def warning(self, msg: str, *args, **kwargs) -> None: ... - def warn(self, msg: str, *args, **kwargs) -> None: ... - def error(self, msg: str, *args, **kwargs) -> None: ... - def exception(self, msg: str, *args, **kwargs) -> None: ... - def critical(self, msg: str, *args, **kwargs) -> None: ... + def debug(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def info(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def warning(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def warn(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def error(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def exception(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def critical(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... fatal = ... # type: Any - def log(self, level: int, msg: str, *args, **kwargs) -> None: ... + def log(self, level: int, msg: Union[str, unicode], *args, **kwargs) -> None: ... def findCaller(self) -> Tuple[str, int, str]: ... def makeRecord(self, name, level, fn, lno, msg, args, exc_info, func=..., extra=..., sinfo=...): ... @@ -199,14 +199,14 @@ class LoggerAdapter: extra = ... # type: Any def __init__(self, logger, extra) -> None: ... def process(self, msg, kwargs): ... - def debug(self, msg: str, *args, **kwargs) -> None: ... - def info(self, msg: str, *args, **kwargs) -> None: ... - def warning(self, msg: str, *args, **kwargs) -> None: ... - def warn(self, msg: str, *args, **kwargs) -> None: ... - def error(self, msg: str, *args, **kwargs) -> None: ... - def exception(self, msg: str, *args, **kwargs) -> None: ... - def critical(self, msg: str, *args, **kwargs) -> None: ... - def log(self, level: int, msg: str, *args, **kwargs) -> None: ... + def debug(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def info(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def warning(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def warn(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def error(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def exception(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def critical(self, msg: Union[str, unicode], *args, **kwargs) -> None: ... + def log(self, level: int, msg: Union[str, unicode], *args, **kwargs) -> None: ... def isEnabledFor(self, level: int) -> bool: ... def setLevel(self, level: int) -> None: ... def getEffectiveLevel(self) -> int: ... @@ -218,16 +218,16 @@ def critical(msg: str, *args, **kwargs) -> None: ... fatal = ... # type: Any -def error(msg: str, *args, **kwargs) -> None: ... +def error(msg: Union[str, unicode], *args, **kwargs) -> None: ... @overload -def exception(msg: str, *args, **kwargs) -> None: ... +def exception(msg: Union[str, unicode], *args, **kwargs) -> None: ... @overload def exception(exception: Exception, *args, **kwargs) -> None: ... -def warning(msg: str, *args, **kwargs) -> None: ... -def warn(msg: str, *args, **kwargs) -> None: ... -def info(msg: str, *args, **kwargs) -> None: ... -def debug(msg: str, *args, **kwargs) -> None: ... -def log(level: int, msg: str, *args, **kwargs) -> None: ... +def warning(msg: Union[str, unicode], *args, **kwargs) -> None: ... +def warn(msg: Union[str, unicode], *args, **kwargs) -> None: ... +def info(msg: Union[str, unicode], *args, **kwargs) -> None: ... +def debug(msg: Union[str, unicode], *args, **kwargs) -> None: ... +def log(level: int, msg: Union[str, unicode], *args, **kwargs) -> None: ... def disable(level: int) -> None: ... class NullHandler(Handler): diff --git a/stdlib/2.7/subprocess.pyi b/stdlib/2.7/subprocess.pyi index ec9f89625..6053a4ede 100644 --- a/stdlib/2.7/subprocess.pyi +++ b/stdlib/2.7/subprocess.pyi @@ -57,7 +57,7 @@ class Popen: def poll(self) -> int: ... def wait(self) -> int: ... # Return str/bytes - def communicate(self, input: str = ...) -> Tuple[str, str]: ... + def communicate(self, input: Union[str, unicode] = ...) -> Tuple[str, str]: ... def send_signal(self, signal: int) -> None: ... def terminate(self) -> None: ... def kill(self) -> None: ...