Skip to content

Commit c7287a1

Browse files
committed
Merge pull request google#863 from RJPercival/stop_using_flags_as_default_args
Avoid trying to read flags when a module is imported
2 parents 4717f34 + 179258f commit c7287a1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

python/ct/cert_analysis/tld_list.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
class TLDList(object):
1414
"""Contains list of top-level domains"""
1515
NOT_ADDRESS_REGEX = re.compile('[^a-z0-9\-.*]')
16-
def __init__(self, tld_dir=FLAGS.tld_list_dir, tld_file_name="tld_list"):
16+
def __init__(self, tld_dir=None, tld_file_name='tld_list'):
17+
if tld_dir is None:
18+
tld_dir = FLAGS.tld_list_dir
19+
1720
tld_file = '/'.join((tld_dir, tld_file_name))
1821
try:
1922
with open(tld_file, 'r') as f:

python/ct/client/reporter.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,10 @@ class CertificateReport(object):
104104
__metaclass__ = abc.ABCMeta
105105

106106
def __init__(self, checks=all_checks.ALL_CHECKS,
107-
pool_size=FLAGS.reporter_workers,
108-
queue_size=FLAGS.reporter_queue_size):
107+
queue_size=None):
109108
self.reset()
110109
self.checks = checks
111-
self._jobs = Queue(queue_size)
110+
self._jobs = Queue(queue_size or FLAGS.reporter_queue_size)
112111
self._pool = None
113112
self._writing_handler = None
114113

0 commit comments

Comments
 (0)