Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(691)

Unified Diff: venv/Lib/site-packages/django/utils/glob.py

Issue 554060043: testMe
Patch Set: Created 2 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « venv/Lib/site-packages/django/utils/functional.py ('k') | venv/Lib/site-packages/django/utils/html.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: venv/Lib/site-packages/django/utils/glob.py
===================================================================
new file mode 100644
--- /dev/null
+++ b/venv/Lib/site-packages/django/utils/glob.py
@@ -0,0 +1,21 @@
+from __future__ import unicode_literals
+
+import os.path
+import re
+
+from django.utils import six
+
+# backport of Python 3.4's glob.escape
+
+if six.PY3:
+ from glob import escape as glob_escape
+else:
+ _magic_check = re.compile('([*?[])')
+
+ def glob_escape(pathname):
+ """
+ Escape all special characters.
+ """
+ drive, pathname = os.path.splitdrive(pathname)
+ pathname = _magic_check.sub(r'[\1]', pathname)
+ return drive + pathname
« no previous file with comments | « venv/Lib/site-packages/django/utils/functional.py ('k') | venv/Lib/site-packages/django/utils/html.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b