Add more complete type hints for pkg_resources. (#2433)

The current file only covers pkg_resources/__init__.py.
pkg_resources/py31compat.pyi is used by setuptools, for example.
This commit is contained in:
Teddy Sudol
2018-09-13 13:00:04 -07:00
committed by Sebastian Rittau
parent 47f22a341e
commit b40cae139f
2 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
from typing import Text
import os
import sys
needs_makedirs: bool
def _makedirs_31(path: Text, exist_ok: bool = ...) -> None: ...
# _makedirs_31 has special behavior to handle an edge case that was removed in
# 3.4.1. No one should be using 3.4 instead of 3.4.1, so this should be fine.
if sys.version_info >= (3,):
makedirs = os.makedirs
else:
makedirs = _makedirs_31