Skip to content

Commit 8abd0fd

Browse files
committed
Move BugzillaError to its own file exceptions.py
Rather than grouping it with transport.py, which was only for simplicity Signed-off-by: Cole Robinson <crobinso@redhat.com>
1 parent f3a1ba9 commit 8abd0fd

4 files changed

Lines changed: 16 additions & 10 deletions

File tree

bugzilla/__init__.py

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

1212
from .apiversion import version, __version__
1313
from .base import Bugzilla
14-
from .transport import BugzillaError
14+
from .exceptions import BugzillaError
1515
from .rhbugzilla import RHBugzilla
1616
from .oldclasses import (Bugzilla3, Bugzilla32, Bugzilla34, Bugzilla36,
1717
Bugzilla4, Bugzilla42, Bugzilla44,

bugzilla/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@
3838
from ._rc import DEFAULT_CONFIGPATHS, open_bugzillarc
3939
from .apiversion import __version__
4040
from .bug import Bug, User
41-
from .transport import (BugzillaError,
42-
_BugzillaSession,
43-
_BugzillaXMLRPCProxy)
41+
from .exceptions import BugzillaError
42+
from .transport import _BugzillaSession, _BugzillaXMLRPCProxy
4443

4544

4645
log = getLogger(__name__)

bugzilla/exceptions.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This program is free software; you can redistribute it and/or modify it
2+
# under the terms of the GNU General Public License as published by the
3+
# Free Software Foundation; either version 2 of the License, or (at your
4+
# option) any later version. See http://www.gnu.org/copyleft/gpl.html for
5+
# the full text of the license.
6+
7+
8+
class BugzillaError(Exception):
9+
"""
10+
Error raised in the Bugzilla client code.
11+
"""

bugzilla/transport.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@
2121

2222
import requests
2323

24-
25-
log = getLogger(__name__)
24+
from .exceptions import BugzillaError
2625

2726

28-
class BugzillaError(Exception):
29-
"""
30-
Error raised in the Bugzilla client code.
31-
"""
27+
log = getLogger(__name__)
3228

3329

3430
class _BugzillaTokenCache(object):

0 commit comments

Comments
 (0)