Browse Source

[python] don't add newlines to an empty buffer

Dan Korostelev 10 năm trước cách đây
mục cha
commit
68298d236d
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      genpy.ml

+ 1 - 1
genpy.ml

@@ -1772,7 +1772,7 @@ module Generator = struct
 		end)
 
 	let newline ctx =
-		spr ctx "\n"
+		if not (Buffer.length ctx.buf = 0) then spr ctx "\n"
 
 
 	(* Generating functions *)