Browse Source

[python] use code interpolation to avoid problems with variable renaming (closes #4594)

Dan Korostelev 10 years ago
parent
commit
efa707d6e5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      std/python/_std/sys/net/Socket.hx

+ 1 - 1
std/python/_std/sys/net/Socket.hx

@@ -92,7 +92,7 @@ private class SocketOutput extends haxe.io.Output {
     public override function writeBytes( buf : haxe.io.Bytes, pos : Int, len : Int) : Int {
         try {
             var data    = buf.getData();
-            var payload = python.Syntax.pythonCode("data[pos:pos+len]");
+            var payload = python.Syntax.pythonCode("data[{0}:{0}+{1}]", pos, len);
             var r = __s.send(payload,0);
             return r;
         } catch( e : BlockingIOError ) {