aboutsummaryrefslogtreecommitdiff
path: root/mammoth/compat.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-05-18 19:52:04 +0100
committerMichael Williamson <mike@zwobble.org>2017-05-18 19:53:14 +0100
commit85f99611c84cf0853200fb358f135160c063b690 (patch)
treec266a0c36e41653b43f10b00054eb5d27924b0b4 /mammoth/compat.py
parent54980f619dd055b5797db131f47a3805f4fe4050 (diff)
Add anchor on hyperlinks as fragment if present
Diffstat (limited to 'mammoth/compat.py')
-rw-r--r--mammoth/compat.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mammoth/compat.py b/mammoth/compat.py
new file mode 100644
index 0000000..5fb9acf
--- /dev/null
+++ b/mammoth/compat.py
@@ -0,0 +1,9 @@
+import sys
+
+if sys.version_info < (3, ):
+ from urlparse import urldefrag
+else:
+ from urllib.parse import urldefrag
+
+
+__all__ = ["urldefrag"]