From 4f4fcff80788bec5b2a1f06c27887be42b21ea92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Thu, 9 Jun 2011 11:58:49 +0000 Subject: [PATCH] graph: only replace allowed characters which are -,+,_ --- pisi/graph.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pisi/graph.py b/pisi/graph.py index 28e5a27a..1e01f8e6 100644 --- a/pisi/graph.py +++ b/pisi/graph.py @@ -139,8 +139,7 @@ class Digraph(object): def id_str(self, u): # Graph format only accepts underscores as key values # Sanitize the values. This is 2x faster than the old method. - return ''.join([ch if ch not in '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' \ - else '_' for ch in u]) + return u.replace("-", "_").replace("+", "_") def write_graphviz(self, f): f.write('digraph G {\n')