incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [06/23] git commit: [#6535] ticket:423 added exception handling
Date Thu, 19 Sep 2013 15:31:48 GMT
[#6535] ticket:423 added exception handling


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/da98a804
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/da98a804
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/da98a804

Branch: refs/heads/master
Commit: da98a8048132b8203058e6545cbe165d72977fac
Parents: 51b9042
Author: coldmind <sokandpal@yandex.ru>
Authored: Wed Sep 11 16:08:12 2013 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Sep 19 14:46:50 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/da98a804/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 01a08e4..ec9729f 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -132,7 +132,12 @@ class GitHubTrackerImporter(ToolImporter):
         REGEXP = r'!\[[\w0-9]+?\]\(((?:https?:\/\/)?[\da-z\.-]+\.[a-z\.]{2,6}'\
             '(?:[\/\w\.-]+)*.(jpg|jpeg|png|gif))\)\r\n'
         attachments = []
-        found_matches = re.finditer(REGEXP, body, re.IGNORECASE)
+
+        try:
+            found_matches = re.finditer(REGEXP, body, re.IGNORECASE)
+        except TypeError:
+            found_matches = re.finditer(REGEXP, str(body), re.IGNORECASE)
+
         for i, match in enumerate(found_matches):
             # removing attach text from comment
             body = body.replace(match.group(0), '')


Mime
View raw message