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

Commit

Permalink
Merge pull request #263 from maarten-boot/development
Browse files Browse the repository at this point in the history
fix for LastWhois not being emptied between calls
  • Loading branch information
maarten-boot authored Jan 31, 2023
2 parents 8807cd4 + ce99396 commit 678f9f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test2.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def testItem(d: str, printgetRawWhoisResult: bool = False):

if w is None:
print("None")
print("\n", whois.get_last_raw_whois_data())
return

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

print("\n", whois.get_last_raw_whois_data())

def errorItem(d, e, what="Generic"):
if what not in Failures:
Expand Down
2 changes: 1 addition & 1 deletion whois/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ def doUnsupportedTldAnyway(
"Try": [],
}


def get_last_raw_whois_data():
global LastWhois
return LastWhois
Expand Down Expand Up @@ -226,6 +225,7 @@ def query(
if the tld is unsupported, just try it anyway but return only the raw text.
"""
global LastWhois
LastWhois["Try"] = [] # init on start of query

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

0 comments on commit 678f9f6

Please sign in to comment.