Skip to content

Commit 9e8c641

Browse files
committed
Removing usages of rdflib.py3compat (#36)
1 parent 3f820d3 commit 9e8c641

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

rdflib_sqlalchemy/termutils.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Convenience functions for working with Terms and Graphs."""
22
from rdflib import BNode, Graph, Literal, URIRef, Variable
33
from rdflib.graph import QuotedGraph
4-
from rdflib.py3compat import format_doctest_out
54
from rdflib.term import Statement
65

76
from rdflib_sqlalchemy.constants import (
@@ -25,7 +24,6 @@
2524
}
2625

2726

28-
@format_doctest_out
2927
def normalize_graph(graph):
3028
"""
3129
Take an instance of a ``Graph`` and return the instance's identifier and ``type``.
@@ -42,13 +40,13 @@ def normalize_graph(graph):
4240
>>> memstore = plugin.get('IOMemory', Store)()
4341
>>> g = Graph(memstore, URIRef("http://purl.org/net/bel-epa/gjh"))
4442
>>> normalize_graph(g)
45-
(rdflib.term.URIRef(%(u)s'http://purl.org/net/bel-epa/gjh'), 'U')
43+
(rdflib.term.URIRef(u'http://purl.org/net/bel-epa/gjh'), 'U')
4644
>>> g = ConjunctiveGraph(memstore, Namespace("http://rdflib.net/ns"))
4745
>>> normalize_graph(g) #doctest: +ELLIPSIS
48-
(rdflib.term.URIRef(%(u)s'http://rdflib.net/ns'), 'U')
46+
(rdflib.term.URIRef(u'http://rdflib.net/ns'), 'U')
4947
>>> g = QuotedGraph(memstore, Namespace("http://rdflib.net/ns"))
5048
>>> normalize_graph(g)
51-
(rdflib.term.URIRef(%(u)s'http://rdflib.net/ns'), 'F')
49+
(rdflib.term.URIRef(u'http://rdflib.net/ns'), 'F')
5250
5351
"""
5452
if isinstance(graph, QuotedGraph):
@@ -57,7 +55,6 @@ def normalize_graph(graph):
5755
return graph.identifier, term_to_letter(graph.identifier)
5856

5957

60-
@format_doctest_out
6158
def term_to_letter(term):
6259
"""
6360
Relate a given term to one of several key types.
@@ -79,9 +76,9 @@ def term_to_letter(term):
7976
'U'
8077
>>> term_to_letter(BNode())
8178
'B'
82-
>>> term_to_letter(Literal(%(u)s'')) # noqa
79+
>>> term_to_letter(Literal(u'')) # noqa
8380
'L'
84-
>>> term_to_letter(Variable(%(u)s'x')) # noqa
81+
>>> term_to_letter(Variable(u'x')) # noqa
8582
'V'
8683
>>> term_to_letter(Graph())
8784
'B'

test/graph_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from rdflib import Graph, URIRef, Literal, plugin, RDF
55
from rdflib.parser import StringInputSource
6-
from rdflib.py3compat import PY3
6+
from six import PY3
77
from rdflib.store import Store
88

99

test/test_sqlalchemy_mysql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from nose import SkipTest
66
from rdflib import Literal
77
from rdflib.graph import ConjunctiveGraph as Graph
8-
from rdflib.py3compat import PY3
8+
from six import PY3
99
from rdflib.store import NO_STORE, VALID_STORE
1010
from rdflib.term import URIRef
1111

0 commit comments

Comments
 (0)