From 160491d0384285698d726b1af21277f336107f51 Mon Sep 17 00:00:00 2001 From: smiddlek Date: Fri, 16 Nov 2012 19:17:52 +0000 Subject: Patch for Issue #47, provided by gps@google.com git-svn-id: http://pymox.googlecode.com/svn/trunk@75 b1010a0a-674b-0410-b734-77272b80c875 --- mox.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mox.py') diff --git a/mox.py b/mox.py index f250187..48f6391 100755 --- a/mox.py +++ b/mox.py @@ -61,6 +61,10 @@ Suggested usage / workflow: my_mox.VerifyAll() """ +try: + import abc +except ImportError: + abc = None # Python 2.5 and earlier from collections import deque import difflib import inspect @@ -260,6 +264,8 @@ class Mox(object): # A list of types that may be stubbed out with a MockObjectFactory. _USE_MOCK_FACTORY = [types.ClassType, types.ObjectType, types.TypeType] + if abc: + _USE_MOCK_FACTORY.append(abc.ABCMeta) def __init__(self): """Initialize a new Mox.""" -- cgit v1.2.1