This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch TINKERPOP-2279
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 0667219b9cd0b5090a3085eaff394a04602b9e9d
Author: Stephen Mallette <[email protected]>
AuthorDate: Mon Aug 26 13:38:14 2019 -0400

    Factor away varargs in as_bytes in GraphBinary for python
---
 .../main/jython/gremlin_python/structure/io/graphbinaryV1.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphbinaryV1.py 
b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphbinaryV1.py
index bec5d94..c287fe0 100644
--- 
a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphbinaryV1.py
+++ 
b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphbinaryV1.py
@@ -193,17 +193,17 @@ class _GraphBinaryTypeIO(object):
                  "filter_": "filter", "id_": "id", "max_": "max", "min_": 
"min", "sum_": "sum"}
 
     @classmethod
-    def as_bytes(cls, graphbin_type, as_value=False, nullable=True, *args):
+    def as_bytes(cls, graphbin_type, as_value=False, nullable=True, 
bytes_to_write=bytes()):
         ba = bytearray() if as_value else bytearray([graphbin_type.value])
 
         if nullable:
             ba.extend(struct.pack(">b", 0))
 
-        for arg in args:
-            if isinstance(arg, (bytes, bytearray)):
-                ba.extend(arg)
-            else:
-                raise Exception("MISSING")
+        if isinstance(bytes_to_write, (bytes, bytearray)):
+            ba.extend(bytes_to_write)
+        else:
+            raise Exception("MISSING")
+
         return ba
 
     @classmethod

Reply via email to