Skip to content
  • dtu's avatar
    [telemetry] Move stale .pyc check from Python import to gclient hook. · 94f4bd9c
    dtu authored
    This check turns out to be fairly expensive on Windows (~150ms), and having
    it at import time means we're taking the hit every time we launch
    memory_cache_http_server. We only need to do this if the Python files have
    changed, so move it to runhooks.
    
    The reason this check exists in the first place is that we've had problems in
    the past where e.g. someone renames foo.py to foo/__init__.py. foo.pyc remains
    on the filesystem of every Chromium checkout and causes a name conflict in
    Python imports - foo can refer to the compiled module or the package.
    
    BUG=388256
    TEST=git rm a file in src/tools that has a .pyc; git commit; gclient runhooks; ensure .pyc doesn't exist; undo commit
    
    Review URL: https://codereview.chromium.org/489693002
    
    Cr-Commit-Position: refs/heads/master@{#291825}
    94f4bd9c