blob: 211ee0e49c08392950e1d6543f8faeff658ab2e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
diff -ur testfixtures-2.3.4.orig/testfixtures/components.py testfixtures-2.3.4/testfixtures/components.py
--- testfixtures/components.py 2011-10-12 00:21:45.000000000 +0800
+++ testfixtures/components.py 2012-05-21 19:04:54.676883008 +0800
@@ -20,8 +20,11 @@
atexit_setup = False
def __init__(self):
- self.registry = Components('Testing')
- self.old = getSiteManager.sethook(lambda:self.registry)
+ try:
+ self.registry = Components('Testing')
+ self.old = getSiteManager.sethook(lambda:self.registry)
+ except:
+ pass
self.instances.add(self)
if not self.__class__.atexit_setup:
atexit.register(self.atexit)
@@ -33,7 +36,10 @@
was in place before this :class:`TestComponents` was
instantiated.
"""
- getSiteManager.sethook(self.old)
+ try:
+ getSiteManager.sethook(self.old)
+ except:
+ pass
self.instances.remove(self)
@classmethod
Only in testfixtures-2.3.4/testfixtures: __pycache__
|