Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ matrix:
env: USE_MYPY=true
allow_failures:
- python: 3.8-dev
- python: 3.5.1

install:
- pip install -r requirements.txt
Expand Down
17 changes: 12 additions & 5 deletions pyannotate_runtime/collect_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,6 @@ def type_consumer():

running = False

TOP_DIR = os.path.join(os.getcwd(), '') # current dir with trailing slash
TOP_DIR_DOT = os.path.join(TOP_DIR, '.')
TOP_DIR_LEN = len(TOP_DIR)


def _make_sampling_sequence(n):
# type: (int) -> List[int]
"""
Expand Down Expand Up @@ -784,6 +779,18 @@ def start():
sampling_counters.clear()


TOP_DIR = os.path.join(os.getcwd(), '') # current dir with trailing slash
TOP_DIR_DOT = os.path.join(TOP_DIR, '.')
TOP_DIR_LEN = len(TOP_DIR)


def set_top_dir(directory):
global TOP_DIR, TOP_DIR_DOT, TOP_DIR_LEN
TOP_DIR = directory
TOP_DIR_DOT = os.path.join(TOP_DIR, '.')
TOP_DIR_LEN = len(TOP_DIR)


def default_filter_filename(filename):
# type: (Optional[str]) -> Optional[str]
"""Default filter for filenames.
Expand Down