[egenix-users] 'dict' not defined in mx/TextTools/TextTools.py line 381

Joel Rosdahl joel at rosdahl.net
Fri Jul 18 13:49:30 CEST 2003


Hi,

Igor Stroh reported the following to the Debian bugtracking system:

> here's the error I get when calling tagdict() from
> mx/TextTools/TextTools.py:
> 
> File "/usr/lib/python2.1/site-packages/mx/TextTools/TextTools.py", line 381, in tagdict
>     tagdict(text,dict,pfx+'.',s)
>     NameError: global name 'dict' is not defined
> 
> it seems like it's merely a typo...

I think this patch fixes the problem:

--- mx/TextTools/TextTools.py~	2001-12-12 13:05:28.000000000 +0100
+++ mx/TextTools/TextTools.py	2003-06-15 10:46:41.000000000 +0200
@@ -373,12 +373,7 @@
     if not rc:
         return (rc,None,next)
     d = {}
-    tagdict = _tagdict
-    for o,l,r,s in taglist:
-        pfx = str(o)
-        d[pfx] = text[l:r]
-        if s:
-            tagdict(text,dict,pfx+'.',s)
+    _tagdict(text,d,'',taglist)
     return (rc,d,next)

 def invset(chars):

        Regards,
        Joel

-- 
Joel Rosdahl <joel at rosdahl.net>  (GnuPG/PGP key available)


More information about the egenix-users mailing list