Browse Source

[python] Get rid of blank lines between imports, add one blank line after all imports.

Dan Korostelev 11 năm trước cách đây
mục cha
commit
266b9bf61b
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      genpy.ml

+ 2 - 2
genpy.ml

@@ -1943,7 +1943,6 @@ module Generator = struct
 						(* importing a class from a module *)
 						"from " ^ module_name ^ " import " ^ object_name ^ " as " ^ class_name
 			in
-			if Buffer.length ctx.buf > 0 then newline ctx;
 			if ignore_error then begin
 				spr_line ctx "try:";
 				spr ctx "\t";
@@ -2130,7 +2129,8 @@ module Generator = struct
 			match mt with
 			| TClassDecl c when c.cl_extern -> gen_import ctx c
 			| _ -> ()
-		) ctx.com.types
+		) ctx.com.types;
+		newline ctx
 
 	let gen_types ctx =
 		let used_paths = Hashtbl.create 0 in