mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update dukpy
This commit is contained in:
parent
d2e42dd4a6
commit
0cc5371090
@ -1,5 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
from threading import Thread, Event
|
from threading import Thread, Event
|
||||||
from duktape import dukpy
|
from duktape import dukpy
|
||||||
@ -128,9 +129,10 @@ class EvalTests(unittest.TestCase):
|
|||||||
self.ctx = Context()
|
self.ctx = Context()
|
||||||
self.g = self.ctx.g
|
self.g = self.ctx.g
|
||||||
|
|
||||||
self.testfile = 'dukpy_test.js'
|
with tempfile.NamedTemporaryFile(
|
||||||
with open(self.testfile, 'w') as fobj:
|
prefix='dukpy-test-', suffix='.js', delete=False) as fobj:
|
||||||
fobj.write('1+1')
|
fobj.write(b'1+1')
|
||||||
|
self.testfile = fobj.name
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
os.remove(self.testfile)
|
os.remove(self.testfile)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user