Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1c3e01

Browse files
committed
optparse TYPE_CHECKER signature is 'def check_mytype(option, opt, value)'
1 parent d3def38 commit a1c3e01

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rethinkdb/utils_common.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ def format_epilog(self, formatter):
153153
def __init__(self, *args, **kwargs):
154154
# -- Type Checkers
155155

156-
def check_tls_option(opt_str, value):
156+
def check_tls_option(_, opt_str, value):
157157
value = str(value)
158158

159159
if os.path.isfile(value):
160160
return {'ca_certs': os.path.realpath(value)}
161161
else:
162162
raise optparse.OptionValueError('Option %s value is not a file: %r' % (opt_str, value))
163163

164-
def check_db_table_option(value):
164+
def check_db_table_option(_, opt_str, value):
165165
res = _tableNameRegex.match(value)
166166

167167
if not res:
@@ -171,7 +171,7 @@ def check_db_table_option(value):
171171

172172
return DbTable(res.group('db'), res.group('table'))
173173

174-
def check_positive_int(opt_str, value):
174+
def check_positive_int(_, opt_str, value):
175175
if not isinstance(value, int) or value < 1:
176176
raise optparse.OptionValueError('%s value must be an integer greater that 1: %s' % (opt_str, value))
177177

@@ -183,7 +183,7 @@ def check_existing_file(_, opt_str, value):
183183

184184
return os.path.realpath(value)
185185

186-
def check_new_file_location(opt_str, value):
186+
def check_new_file_location(_, opt_str, value):
187187
try:
188188
real_value = os.path.realpath(value)
189189
except Exception:
@@ -194,7 +194,7 @@ def check_new_file_location(opt_str, value):
194194

195195
return real_value
196196

197-
def file_contents(opt_str, value):
197+
def file_contents(_, opt_str, value):
198198
if not os.path.isfile(value):
199199
raise optparse.OptionValueError('%s value is not an existing file: %r' % (opt_str, value))
200200

0 commit comments

Comments
 (0)