kopia lustrzana https://github.com/wagtail/wagtail
Add Python 2 check to `wagtail` command
rodzic
59506ae69f
commit
96061ae301
|
@ -34,6 +34,7 @@ Changelog
|
|||
2.0.1 (xx.xx.xxxx) - IN DEVELOPMENT
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Added error notification when running the `wagtail` command on Python <3.4 (Matt Westcott)
|
||||
* Fix: Draftail now supports features specified via the `WAGTAILADMIN_RICH_TEXT_EDITORS` setting (Todd Dembrey)
|
||||
* Fix: Password reset form no longer indicates whether the email is recognised, as per standard Django behaviour (Bertrand Bordage)
|
||||
* Fix: `UserAttributeSimilarityValidator` is now correctly enforced on user creation / editing forms (Tim Heap)
|
||||
|
|
|
@ -10,6 +10,8 @@ Wagtail 2.0.1 release notes - IN DEVELOPMENT
|
|||
What's new
|
||||
==========
|
||||
|
||||
* Added error notification when running the ``wagtail`` command on Python <3.4 (Matt Westcott)
|
||||
|
||||
Bug fixes
|
||||
~~~~~~~~~
|
||||
|
||||
|
|
|
@ -8,6 +8,16 @@ from argparse import ArgumentParser
|
|||
from difflib import unified_diff
|
||||
|
||||
from django.core.management import ManagementUtility
|
||||
# Need to use the django.utils.six version of print, to avoid a syntax error on Py2 when using print(..., end='')
|
||||
from django.utils.six import print_
|
||||
|
||||
|
||||
CURRENT_PYTHON = sys.version_info[:2]
|
||||
REQUIRED_PYTHON = (3, 4)
|
||||
|
||||
if CURRENT_PYTHON < REQUIRED_PYTHON:
|
||||
sys.stderr.write("This version of Wagtail requires Python {}.{} or above - you are running {}.{}\n".format(*(REQUIRED_PYTHON + CURRENT_PYTHON)))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def pluralize(value, arg='s'):
|
||||
|
@ -227,7 +237,7 @@ class UpdateModulePaths(Command):
|
|||
with fileinput.FileInput(filename, inplace=True) as f:
|
||||
for original_line in f:
|
||||
line = self._rewrite_line(original_line)
|
||||
print(line, end='') # NOQA
|
||||
print_(line, end='') # NOQA
|
||||
if line != original_line:
|
||||
change_count += 1
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue