Merge pull request #1767 from nixy/master
Allow Hy to run when installed in read only filesystem
This commit is contained in:
commit
57326785b9
1
AUTHORS
1
AUTHORS
@ -90,3 +90,4 @@
|
|||||||
* Yigong Wang <wang@yigo.ng>
|
* Yigong Wang <wang@yigo.ng>
|
||||||
* Oskar Kvist <oskar.kvist@gmail.com>
|
* Oskar Kvist <oskar.kvist@gmail.com>
|
||||||
* Brandon T. Willard <brandonwillard@gmail.com>
|
* Brandon T. Willard <brandonwillard@gmail.com>
|
||||||
|
* Andrew R. M. <nixy@nixy.moe>
|
||||||
|
5
NEWS.rst
5
NEWS.rst
@ -12,6 +12,11 @@ New Features
|
|||||||
* Format strings with embedded Hy code (e.g., `f"The sum is {(+ x y)}"`)
|
* Format strings with embedded Hy code (e.g., `f"The sum is {(+ x y)}"`)
|
||||||
are now supported, even on Pythons earlier than 3.6.
|
are now supported, even on Pythons earlier than 3.6.
|
||||||
|
|
||||||
|
Bug Fixes
|
||||||
|
------------------------------
|
||||||
|
* Fixed a crash caused by errors creating temp files during bytecode
|
||||||
|
compilation
|
||||||
|
|
||||||
0.16.0
|
0.16.0
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
|
@ -467,9 +467,10 @@ else:
|
|||||||
if cfile is None:
|
if cfile is None:
|
||||||
cfile = cache_from_source(filename)
|
cfile = cache_from_source(filename)
|
||||||
|
|
||||||
f = tempfile.NamedTemporaryFile('wb', dir=os.path.split(cfile)[0],
|
f = None
|
||||||
delete=False)
|
|
||||||
try:
|
try:
|
||||||
|
f = tempfile.NamedTemporaryFile('wb', dir=os.path.split(cfile)[0],
|
||||||
|
delete=False)
|
||||||
f.write('\0\0\0\0')
|
f.write('\0\0\0\0')
|
||||||
f.write(struct.pack('<I', timestamp))
|
f.write(struct.pack('<I', timestamp))
|
||||||
f.write(marshal.dumps(codeobject))
|
f.write(marshal.dumps(codeobject))
|
||||||
@ -489,7 +490,8 @@ else:
|
|||||||
os.rename(f.name, cfile)
|
os.rename(f.name, cfile)
|
||||||
except OSError:
|
except OSError:
|
||||||
try:
|
try:
|
||||||
os.unlink(f.name)
|
if f is not None:
|
||||||
|
os.unlink(f.name)
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user