From e69bec127295ff9bd323140bf1ed7d62da580914 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Wed, 29 Apr 2015 18:55:56 +0200 Subject: [PATCH] Don't rely on case-sensitive imports, fix #282 We should burn PEP 235, bicameral scripts, encodings, Python2/3 compatibility, Windows, MacOS X, filenames, unicode (including composite characters), and the whole world. And LF/CR too, of course. Let's recreate a language relying on only two characters. Anyone interested? --- radicale/rights/regex.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/radicale/rights/regex.py b/radicale/rights/regex.py index 523f735..35e5893 100644 --- a/radicale/rights/regex.py +++ b/radicale/rights/regex.py @@ -39,19 +39,18 @@ Leading or ending slashes are trimmed from collection's path. """ import re +import sys import os.path from .. import config, log # Manage Python2/3 different modules -# pylint: disable=F0401 -try: - from configparser import ConfigParser - from io import StringIO -except ImportError: +if sys.version_info[0] == 2: from ConfigParser import ConfigParser from StringIO import StringIO -# pylint: enable=F0401 +else: + from configparser import ConfigParser + from io import StringIO DEFINED_RIGHTS = {