From 579288c5eb684dd09d1ef298929a566f40151205 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Wed, 27 Feb 2013 09:10:47 -0500 Subject: Now using universal code for Python 2 & 3. The most notable changes are the use of unicode_literals and absolute_imports. Actually, absolute_imports was the biggest deal as it gives us relative imports. For the first time extensions import markdown relative to themselves. This allows other packages to embed the markdown lib in a subdir of their project and still be able to use our extensions. --- markdown/extensions/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'markdown/extensions/__init__.py') diff --git a/markdown/extensions/__init__.py b/markdown/extensions/__init__.py index 0222c91..960d8f9 100644 --- a/markdown/extensions/__init__.py +++ b/markdown/extensions/__init__.py @@ -1,9 +1,10 @@ +from __future__ import unicode_literals """ Extensions ----------------------------------------------------------------------------- """ -class Extension: +class Extension(object): """ Base class for extensions to subclass. """ def __init__(self, configs = {}): """Create an instance of an Extention. @@ -46,6 +47,6 @@ class Extension: * md_globals: Global variables in the markdown module namespace. """ - raise NotImplementedError, 'Extension "%s.%s" must define an "extendMarkdown"' \ - 'method.' % (self.__class__.__module__, self.__class__.__name__) + raise NotImplementedError('Extension "%s.%s" must define an "extendMarkdown"' \ + 'method.' % (self.__class__.__module__, self.__class__.__name__)) -- cgit v1.2.3