[Seqinr-commits] r1463 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Oct 8 20:42:59 CEST 2008


Author: lobry
Date: 2008-10-08 20:42:59 +0200 (Wed, 08 Oct 2008)
New Revision: 1463

Modified:
   pkg/R/autosocket.R
Log:
backward compatibility patch for outdated R version

Modified: pkg/R/autosocket.R
===================================================================
--- pkg/R/autosocket.R	2008-10-08 08:23:52 UTC (rev 1462)
+++ pkg/R/autosocket.R	2008-10-08 18:42:59 UTC (rev 1463)
@@ -19,7 +19,18 @@
   # Check that the socket connection status is OK:
   #
   status <- summary(socket)
-  if(status[["class"]] != "sockconn") stop("socket is not a sockconn")
+  if(status[["class"]] != "sockconn"){
+    #
+    # for backward compatibility: in R 2.6.2 the result was "socket",
+    # so "socket" instead of "sockconn" is temporarilly allowed with
+    # a warning.
+    #
+    if(status[["class"]] != "socket"){
+      stop("socket is not a sockconn")
+    } else {
+      warning("backward compatibility patch used, upgrade your R version asap")
+    }
+  }
   if(status[["opened"]] != "opened") stop("socket is not openend")
   if(status[["can read"]] != "yes") stop("can't read on socket")
   if(status[["can write"]] != "yes") stop("can't write on socket")



More information about the Seqinr-commits mailing list