Skip to content

Commit

Permalink
fixes regression
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Oct 24, 2024
1 parent 79efa7d commit f6d8f9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/test_non_smw.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_category_query(self):
Example: https://wiki.genealogy.net/Kategorie:Adressbuch_in_der_Online-Erfassung/fertig
"""
debug=self.debug
debug=True
#debug=True
wikipush = WikiPush(self.wiki_id, None, debug=self.debug)
wikipush.fromWiki = self.wiki_client

Expand All @@ -62,7 +62,7 @@ def test_category_query(self):
for i,page_title in enumerate(pages,start=1):
if i<=debug_pages:
print(f"{i:3}:{page_title}")
self.assertTrue(len(pages) >= expected_pages)
self.assertGreaterEqual(len(pages),expected_pages)


if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions wikibot3rd/wikipush.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ def queryPages(
"""
if wiki is None:
wiki = self.fromWiki
# no wiki no pages e.g. if wikirestore is used without a -s option
if wiki is None:
pageRecords=[]

if wiki.is_smw_enabled:
smwClient = SMWClient(
Expand Down Expand Up @@ -268,9 +271,6 @@ def query(
Returns:
list: a list of pageTitles matching the given askQuery
"""
# no wiki no pages e.g. if wikirestore is used without a -s option
if wiki is None:
return []
pageRecords = self.queryPages(
askQuery, wiki, limit, showProgress, queryDivision
)
Expand Down

0 comments on commit f6d8f9a

Please sign in to comment.