very strange behavior in "mesh_surface_sketch.py"

Hallo,
I thaught I am clever and change this:


    #### Calculate distance between two points
    def pts_distance(self, p1_co, p2_co):
        p_difs = [p1_co[0] - p2_co[0], p1_co[1] - p2_co[1], p1_co[2] - p2_co[2]]
        distance = abs(sqrt(p_difs[0] * p_difs[0] + p_difs[1] * p_difs[1] + p_difs[2] * p_difs[2]))
        
        return distance

(abs is not neaded I think???)

into


    #### Calculate distance between two points
        
#pkhg 20-7-2010 change to 
    def pts_distance(self, p1_co, p2_co):
        p_difs = p1_co - p2_c0
        return p_difs.length

But now the addon behaves totally different!
Created mesh now consists out of more than one part and not anymore ONE???
(at least in my Blender version, Vista, svn 30499)
See pictures from the changed script :
http://petertregarg.host22.com/pmwiki/uploads/BlenderTemplates/strangeMeshSurface.jpg

Who can confirm this? But even better who can explain this STRANGE BEHAVIOR?

:edit: sorry, found myself
In ‘my’ code there is an typing error p2_c0 and p2_co … (bah!)

You may wish to check if somewhere else prior that function (pts_distance) you have p2_c0 thus forcing python to take it as a global value in the local proc/function…

Regards,