-
Notifications
You must be signed in to change notification settings - Fork 197
Fix pytype error when using adb_logcat_file_path in open #975
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ko1in1u)
mobly/controllers/android_device_lib/services/logcat.py
line 196 at r1 (raw file):
if not self._adb_logcat_file_obj: deadline = time.perf_counter() + CREATE_LOGCAT_FILE_TIMEOUT_SEC while not os.path.exists(self.adb_logcat_file_path):
this already make sure adb_logcat_file_path
won't be None, no?
Yes, this is the place to assign value to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ko1in1u)
mobly/controllers/android_device_lib/services/logcat.py
line 196 at r1 (raw file):
Previously, ko1in1u (Kolin Lu) wrote…
Yes, this is the place to assign value to
adb_logcat_file_path
. However, pytype isn't aware because it performs static analysis and cannot definitively track the runtime assignment ofself.adb_logcat_file_path
fromNone
to a string based on external conditions.
We should not add random checks for linter.
Either tell the linter to ignore this part, or make the assignment logic more explicit so linter stop complaining
Add in-line comment to disable the pytype error. |
This change is