Skip to content
This repository was archived by the owner on Feb 3, 2024. It is now read-only.

Commit 678f9f6

Browse files
authored
Merge pull request #263 from maarten-boot/development
fix for LastWhois not being emptied between calls
2 parents 8807cd4 + ce99396 commit 678f9f6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

test2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ def testItem(d: str, printgetRawWhoisResult: bool = False):
186186

187187
if w is None:
188188
print("None")
189+
print("\n", whois.get_last_raw_whois_data())
189190
return
190191

191192
# the 3 date time items can be None if not present or a datetime string
@@ -204,6 +205,7 @@ def testItem(d: str, printgetRawWhoisResult: bool = False):
204205
else:
205206
print((ss + "%s") % (k, xType(v), v))
206207

208+
print("\n", whois.get_last_raw_whois_data())
207209

208210
def errorItem(d, e, what="Generic"):
209211
if what not in Failures:

whois/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ def doUnsupportedTldAnyway(
187187
"Try": [],
188188
}
189189

190-
191190
def get_last_raw_whois_data():
192191
global LastWhois
193192
return LastWhois
@@ -226,6 +225,7 @@ def query(
226225
if the tld is unsupported, just try it anyway but return only the raw text.
227226
"""
228227
global LastWhois
228+
LastWhois["Try"] = [] # init on start of query
229229

230230
assert isinstance(domain, str), Exception("`domain` - must be <str>")
231231
return_raw_text_for_unsupported_tld = bool(return_raw_text_for_unsupported_tld)

0 commit comments

Comments
 (0)