summaryrefslogtreecommitdiff
path: root/paste/debug/fsdiff.py
diff options
context:
space:
mode:
authorCyril Roelandt <cyril.roelandt@enovance.com>2014-03-18 12:49:12 +0100
committerCyril Roelandt <cyril.roelandt@enovance.com>2014-03-18 12:49:12 +0100
commit674ae7718bc06a8b8c8b658075bf82c8198fb632 (patch)
tree0075bace24ead7f03ae7cb18935e4c707f71a860 /paste/debug/fsdiff.py
parent3cdb7e4227cbaad690b1c1557c03fa6da0decc36 (diff)
downloadpaste-674ae7718bc06a8b8c8b658075bf82c8198fb632.tar.gz
Python 3: use new names of standard library modules
Use "try/except ImportError" to try Python 2 and Python 3 names.
Diffstat (limited to 'paste/debug/fsdiff.py')
-rw-r--r--paste/debug/fsdiff.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/paste/debug/fsdiff.py b/paste/debug/fsdiff.py
index 2849ea8..f680bf6 100644
--- a/paste/debug/fsdiff.py
+++ b/paste/debug/fsdiff.py
@@ -12,7 +12,17 @@ the file was.
import os
from fnmatch import fnmatch
from datetime import datetime
-from paste.util.UserDict24 import IterableUserDict
+
+try:
+ # Python 3
+ import collections.UserDict as IterableUserDict
+except ImportError:
+ try:
+ # Python 2.5-2.7
+ from UserDict import IterableUserDict
+ except ImportError:
+ # Python <= 2.4
+ from paste.util.UserDict24 import IterableUserDict
import operator
import re