8000 scripts/stubtest: make it run again and type-check it by bluetech · Pull Request #7283 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

scripts/stubtest: make it run again and type-check it #7283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 5, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
scripts/dumpmodule: drop Python 2 compatibility
  • Loading branch information
bluetech committed Aug 3, 2019
commit 2fa540a7875620fb32e8212abf05bdde2b6bbea6
17 changes: 2 additions & 15 deletions scripts/dumpmodule.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
"""Dump the runtime structure of a module as JSON.

This is used for testing stubs.

This needs to run in Python 2.7 and 3.x.
"""

from __future__ import print_function

import importlib
import json
import sys
import types
from typing import Text


if sys.version_info >= (3, 0):
import inspect
long = int
else:
import inspect2 as inspect

import inspect


def dump_module(id):
Expand Down Expand Up @@ -75,7 +62,7 @@ def dump_value(value, depth=0):


def dump_simple(value):
if type(value) in (int, bool, float, str, bytes, Text, long, list, set, dict, tuple):
if type(value) in (int, bool, float, str, bytes, list, set, dict, tuple):
return {'type': type(value).__name__}
if value is None:
return {'type': 'None'}
Expand Down
0