diff options
author | David Robillard <d@drobilla.net> | 2014-11-19 19:01:56 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-11-19 19:01:56 +0000 |
commit | e89a43a5f8f513610e9a1fd9aa3221c7a0e1ae2b (patch) | |
tree | 85fb5267aaf68c1e6d4a96e0777213909a2cfaff /scripts/ingen.py | |
parent | 27e81cf8f9a46c8080cac554f8a72afc4ad7963f (diff) | |
download | ingen-e89a43a5f8f513610e9a1fd9aa3221c7a0e1ae2b.tar.gz ingen-e89a43a5f8f513610e9a1fd9aa3221c7a0e1ae2b.tar.bz2 ingen-e89a43a5f8f513610e9a1fd9aa3221c7a0e1ae2b.zip |
Make ingenams work with Python3 and other versions of rdflib.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5490 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'scripts/ingen.py')
-rw-r--r-- | scripts/ingen.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/ingen.py b/scripts/ingen.py index e0a71a47..8eb67d9d 100644 --- a/scripts/ingen.py +++ b/scripts/ingen.py @@ -20,9 +20,9 @@ import socket import sys try: - import StringIO + import StringIO.StringIO as StringIO except ImportError: - from io import StringIO + from io import StringIO as StringIO class NS: ingen = rdflib.Namespace('http://drobilla.net/ns/ingen#') @@ -134,9 +134,9 @@ class Remote(Interface): def recv(self): 'Read from socket until a NULL terminator is received' - msg = '' + msg = u'' while True: - c = self.sock.recv(1, 0) + c = self.sock.recv(1, 0).decode('utf-8') if not c or ord(c[0]) == 0: # End of transmission break else: @@ -178,7 +178,7 @@ class Remote(Interface): response_str = self.recv() response_model = rdflib.Graph() response_model.namespace_manager = self.ns_manager - response_model.parse(StringIO.StringIO(response_str), self.server_base, format='n3') + response_model.parse(StringIO(response_str), self.server_base, format='n3') # Handle response (though there should be only one) blanks = [] |