Skip to content

Commit 5419bb1

Browse files
chadaustinfacebook-github-bot
authored andcommitted
make typecheck pass (work around updated typeshed without thrift stubs)
Summary: D6738525 and D6731821 (python/typeshed#1827) broke type checking on Eden's Python. This works around removing the thrift stubs. Reviewed By: carljm Differential Revision: D6745233 fbshipit-source-id: 760f7ee199698a0a570a993f16b45c833910aade
1 parent 29578f9 commit 5419bb1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

eden/cli/config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import facebook.eden.ttypes as eden_ttypes
2929
from fb303.ttypes import fb_status
3030
import thrift
31-
from typing import Dict, List, Optional
31+
from typing import Any, Dict, List, Optional, cast
3232

3333
# Use --etcEdenDir to change the value used for a given invocation
3434
# of the eden cli.
@@ -521,7 +521,9 @@ def check_health(self) -> 'HealthStatus':
521521
# PID from the Thrift server, we read it from the lockfile and try
522522
# to deduce the current status of Eden.
523523
return self._check_health_using_lockfile()
524-
except thrift.Thrift.TException as ex:
524+
# TODO: thrift.Thrift.TException stopped typechecking in D6738525.
525+
# When possible, remove this cast.
526+
except cast(Any, thrift).Thrift.TException as ex:
525527
detail = 'error talking to edenfs: ' + str(ex)
526528
return HealthStatus(status, pid, detail)
527529

0 commit comments

Comments
 (0)