<div dir="ltr">Hi,<br><br>I've created a function to normalize Subversion URLs, however when I return a string, printing the result of the function becomes "None". When I print the value of the string before I return from the function, I see a valid string. What's going on? The function is below:<br>
<br><br><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);">def normurl( url_root, url ):</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);"> mutableurl = url[len(url_root):]</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);"> </span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);"> split1 = mutableurl.split( "..", 1 ) </span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);"> if len(split1) == 1:</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);"> print "Returning:", split1[0]</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);"> return split1[0]</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);"> </span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);"> split2 = split1[0][:-1].rsplit( "/", 1 )</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 102, 0);"> combined = split2[0] + split1[1]</span><br style="font-family: courier new,monospace; color: rgb(0, 102, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 102, 0);"> normurl( url_root, url_root + combined )</span><br></div>