[Checkins] SVN: z3c.pt/trunk/src/z3c/pt/clauses.py Slight optimization of conditions.
Malthe Borch
mborch at gmail.com
Wed Sep 10 16:16:53 EDT 2008
Log message for revision 91042:
Slight optimization of conditions.
Changed:
U z3c.pt/trunk/src/z3c/pt/clauses.py
-=-
Modified: z3c.pt/trunk/src/z3c/pt/clauses.py
===================================================================
--- z3c.pt/trunk/src/z3c/pt/clauses.py 2008-09-10 20:15:26 UTC (rev 91041)
+++ z3c.pt/trunk/src/z3c/pt/clauses.py 2008-09-10 20:16:53 UTC (rev 91042)
@@ -555,9 +555,11 @@
stream.indent()
stream.write("%s = %s.encode('%s')" % (temp, temp, stream.encoding))
stream.outdent()
-
+ stream.write("elif not isinstance(%s, str):" % temp)
+ else:
+ stream.write("if not isinstance(%s, (str, unicode)):" % temp)
+
# make sure this is a string
- stream.write("if not isinstance(%s, (str, unicode)):" % temp)
stream.indent()
stream.write("%s = str(%s)" % (temp, temp))
stream.outdent()
More information about the Checkins
mailing list