From c0d0f7fe14c280df477509e4939359919b885b3d Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 22 Jan 2016 17:42:45 -0800 Subject: [PATCH] Fix os.environ improperly classified as not mutable for python 2. In Python, you can change the environment by writing to os.environ. This seems to already be handled correctly in the python 3 type data, so we just need to fix it for 2.7. --- stdlib/2.7/__builtin__.pyi | 1 + stdlib/2.7/os/__init__.pyi | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/2.7/__builtin__.pyi b/stdlib/2.7/__builtin__.pyi index 9c59ed922..7f4d6e47d 100644 --- a/stdlib/2.7/__builtin__.pyi +++ b/stdlib/2.7/__builtin__.pyi @@ -824,3 +824,4 @@ def cmp(x: Any, y: Any) -> int: ... def execfile(filename: str, globals: Dict[str, Any] = None, locals: Dict[str, Any] = None) -> None: ... class file(BinaryIO): ... + diff --git a/stdlib/2.7/os/__init__.pyi b/stdlib/2.7/os/__init__.pyi index 18a6fa0a3..73907d6bf 100644 --- a/stdlib/2.7/os/__init__.pyi +++ b/stdlib/2.7/os/__init__.pyi @@ -1,11 +1,11 @@ # created from https://docs.python.org/2/library/os.html -from typing import List, Tuple, Union, Sequence, Mapping, IO, Any, Optional, AnyStr +from typing import List, Tuple, Union, Sequence, Mapping, IO, Any, Optional, AnyStr, MutableMapping import os.path as path error = OSError name = ... # type: str -environ = ... # type: Mapping[str, str] +environ = ... # type: MutableMapping[str, str] def chdir(path: unicode) -> None: ... def fchdir(fd: int) -> None: ...