File: pybel_indexerror.patch

package info (click to toggle)
openbabel 2.4.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 58,308 kB
  • sloc: cpp: 459,210; ansic: 90,514; php: 13,963; python: 7,899; perl: 6,518; pascal: 793; sh: 179; xml: 97; ruby: 64; makefile: 46; java: 23; cs: 14
file content (22 lines) | stat: -rw-r--r-- 834 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From 4c3fe03b571d4740957ec4115992be75019ddc76 Mon Sep 17 00:00:00 2001
From: "Karol M. Langner" <langner@users.noreply.github.com>
Date: Sat, 10 Dec 2016 22:03:43 -0800
Subject: [PATCH] Avoid IndexError for plugins with empty names

---
 scripts/python/pybel.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/python/pybel.py b/scripts/python/pybel.py
index f9aaec280..de85df712 100644
--- a/scripts/python/pybel.py
+++ b/scripts/python/pybel.py
@@ -81,7 +81,7 @@ def _getpluginnames(ptype):
     ob.OBPlugin.ListAsVector(ptype, None, plugins)
     if sys.platform[:4] == "java":
         plugins = [plugins.get(i) for i in range(plugins.size())]
-    return [x.split()[0] for x in plugins]
+    return [x.split()[0] for x in plugins if x.strip()]
 
 _obconv = ob.OBConversion()
 _builder = ob.OBBuilder()