Skip to content

Commit 8f4de66

Browse files
committed
Remove pytype comments further
1 parent ee757c5 commit 8f4de66

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

fire/core_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ def serialize(x):
215215

216216
def testLruCacheDecoratorBoundArg(self):
217217
self.assertEqual(
218-
core.Fire(tc.py3.LruCacheDecoratedMethod, # pytype: disable=module-attr
218+
core.Fire(tc.py3.LruCacheDecoratedMethod,
219219
command=['lru_cache_in_class', 'foo']), 'foo')
220220

221221
def testLruCacheDecorator(self):
222222
self.assertEqual(
223-
core.Fire(tc.py3.lru_cache_decorated, # pytype: disable=module-attr
223+
core.Fire(tc.py3.lru_cache_decorated,
224224
command=['foo']), 'foo')
225225

226226

fire/formatting_windows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import sys
2222

2323
try:
24-
import colorama # pylint: disable=g-import-not-at-top, # pytype: disable=import-error
24+
import colorama # pylint: disable=g-import-not-at-top
2525
HAS_COLORAMA = True
2626
except ImportError:
2727
HAS_COLORAMA = False
@@ -38,9 +38,9 @@ def initialize_or_disable():
3838
# Windows 10, 2016, and 2019 only.
3939

4040
wrap = False
41-
kernel32 = ctypes.windll.kernel32 # pytype: disable=module-attr
41+
kernel32 = ctypes.windll.kernel32
4242
enable_virtual_terminal_processing = 0x04
43-
out_handle = kernel32.GetStdHandle(subprocess.STD_OUTPUT_HANDLE) # pylint: disable=line-too-long, # pytype: disable=module-attr
43+
out_handle = kernel32.GetStdHandle(subprocess.STD_OUTPUT_HANDLE) # pylint: disable=line-too-long,
4444
# GetConsoleMode fails if the terminal isn't native.
4545
mode = ctypes.wintypes.DWORD()
4646
if kernel32.GetConsoleMode(out_handle, ctypes.byref(mode)) == 0:

fire/helptext_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def testHelpTextFunctionWithKwargsAndDefaults(self):
125125

126126
def testHelpTextFunctionWithDefaultsAndTypes(self):
127127
component = (
128-
tc.py3.WithDefaultsAndTypes().double) # pytype: disable=module-attr
128+
tc.py3.WithDefaultsAndTypes().double)
129129
help_screen = helptext.HelpText(
130130
component=component,
131131
trace=trace.FireTrace(component, name='double'))
@@ -139,7 +139,7 @@ def testHelpTextFunctionWithDefaultsAndTypes(self):
139139

140140
def testHelpTextFunctionWithTypesAndDefaultNone(self):
141141
component = (
142-
tc.py3.WithDefaultsAndTypes().get_int) # pytype: disable=module-attr
142+
tc.py3.WithDefaultsAndTypes().get_int)
143143
help_screen = helptext.HelpText(
144144
component=component,
145145
trace=trace.FireTrace(component, name='get_int'))
@@ -153,7 +153,7 @@ def testHelpTextFunctionWithTypesAndDefaultNone(self):
153153
self.assertNotIn('NOTES', help_screen)
154154

155155
def testHelpTextFunctionWithTypes(self):
156-
component = tc.py3.WithTypes().double # pytype: disable=module-attr
156+
component = tc.py3.WithTypes().double
157157
help_screen = helptext.HelpText(
158158
component=component,
159159
trace=trace.FireTrace(component, name='double'))
@@ -168,7 +168,7 @@ def testHelpTextFunctionWithTypes(self):
168168
help_screen)
169169

170170
def testHelpTextFunctionWithLongTypes(self):
171-
component = tc.py3.WithTypes().long_type # pytype: disable=module-attr
171+
component = tc.py3.WithTypes().long_type
172172
help_screen = helptext.HelpText(
173173
component=component,
174174
trace=trace.FireTrace(component, name='long_type'))
@@ -263,14 +263,14 @@ def testHelpTextNoInit(self):
263263
self.assertIn('SYNOPSIS\n OldStyleEmpty', help_screen)
264264

265265
def testHelpTextKeywordOnlyArgumentsWithDefault(self):
266-
component = tc.py3.KeywordOnly.with_default # pytype: disable=module-attr
266+
component = tc.py3.KeywordOnly.with_default
267267
output = helptext.HelpText(
268268
component=component, trace=trace.FireTrace(component, 'with_default'))
269269
self.assertIn('NAME\n with_default', output)
270270
self.assertIn('FLAGS\n -x, --x=X', output)
271271

272272
def testHelpTextKeywordOnlyArgumentsWithoutDefault(self):
273-
component = tc.py3.KeywordOnly.double # pytype: disable=module-attr
273+
component = tc.py3.KeywordOnly.double
274274
output = helptext.HelpText(
275275
component=component, trace=trace.FireTrace(component, 'double'))
276276
self.assertIn('NAME\n double', output)

fire/inspectutils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def Py3GetFullArgSpec(fn):
100100
An inspect.FullArgSpec namedtuple with the full arg spec of the function.
101101
"""
102102
# pylint: disable=no-member
103-
# pytype: disable=module-attr
103+
104104
try:
105105
sig = inspect._signature_from_callable( # pylint: disable=protected-access # type: ignore
106106
fn,
@@ -157,7 +157,6 @@ def Py3GetFullArgSpec(fn):
157157
return inspect.FullArgSpec(args, varargs, varkw, defaults,
158158
kwonlyargs, kwdefaults, annotations)
159159
# pylint: enable=no-member
160-
# pytype: enable=module-attr
161160

162161

163162
def GetFullArgSpec(fn):

fire/trace.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ def __init__(self, initial_component, name=None, separator='-', verbose=False,
6262

6363
def GetResult(self):
6464
"""Returns the component from the last element of the trace."""
65-
6665
return self.GetLastHealthyElement().component
67-
# pytype: enable=attribute-error
6866

6967
def GetLastHealthyElement(self):
7068
"""Returns the last element of the trace that is not an error.

0 commit comments

Comments
 (0)