Merge pull request #1503 from vodik/travis-py37

Add python 3.7-dev to travis, allow it to fail
This commit is contained in:
Kodi Arfer 2018-02-14 08:41:14 -08:00 committed by GitHub
commit 7cf23fabc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -5,8 +5,12 @@ python:
- "3.4"
- "3.5"
- "3.6"
- "3.7-dev"
- pypy
- pypy3
matrix:
allow_failures:
- python: "3.7-dev"
install:
- pip install -r requirements-travis.txt
- pip install -e .

View File

@ -23,6 +23,7 @@ import sys
PY3 = sys.version_info[0] >= 3
PY35 = sys.version_info >= (3, 5)
PY36 = sys.version_info >= (3, 6)
PY37 = sys.version_info >= (3, 7)
str_type = str if PY3 else unicode # NOQA
bytes_type = bytes if PY3 else str # NOQA

View File

@ -18,7 +18,7 @@ import inspect
import os
import __future__
from hy._compat import PY3, MAGIC, builtins, long_type, wr_long
from hy._compat import PY3, PY37, MAGIC, builtins, long_type, wr_long
from hy._compat import string_types
@ -220,6 +220,12 @@ def write_code_as_pyc(fname, code):
with builtins.open(cfile, 'wb') as fc:
fc.write(MAGIC)
if PY37:
# With PEP 552, the header structure has a new flags field
# that we need to fill in. All zeros preserve the legacy
# behaviour, but should we implement reproducible builds,
# this is where we'd add the information.
wr_long(fc, 0)
wr_long(fc, timestamp)
if PY3:
wr_long(fc, st.st_size)