Xqt added a comment.

  Surely not. You cannot have access to module objects if the module is partly 
initialised. In your case the reason is not a circular import but a ImportError 
which is explicitly raised during import of pywikibot. You cannot continue the 
import later, you have to delete the module instead.
  
  I don’t know enough about your application but the solution I’ve given above 
works as expected. Another solution may be:
  
    try:
        import mwparserfromhell
    except ImportError :
        import os
        os.system('pip install mwparserfromhell')
    import pywikibot
  
  Another more general way would to make either mwparserfromhell or 
wikitextparser mandatory.

TASK DETAIL
  https://phabricator.wikimedia.org/T326452

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Xqt
Cc: Xqt, Aklapper, RPI2026F1, pywikibot-bugs-list, Adamm71, Jersione, 
Hellket777, LisafBia6531, 786, Biggs657, PotsdamLamb, Jyoo1011, JohnsonLee01, 
Juan90264, SHEKH, Dijkstra, Alter-paule, Beast1978, Un1tY, Khutuck, Zkhalido, 
Hook696, Kent7301, joker88john, Viztor, CucyNoiD, Wenyi, Gaboe420, Giuliamocci, 
Cpaulf30, Af420, Bsandipan, Tbscho, MayS, Framawiki, Lewizho99, Mdupont, 
JJMC89, Maathavan, Dvorapa, Altostratus, Neuronton, Avicennasis, mys_721tx, 
jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to