[Python-checkins] r58437 - sandbox/trunk/import_in_py/Py3K/tests/mock_importlib.py sandbox/trunk/import_in_py/Py3K/tests/test_fs_loader.py
brett.cannon
python-checkins at python.org
Fri Oct 12 21:06:58 CEST 2007
Author: brett.cannon
Date: Fri Oct 12 21:06:58 2007
New Revision: 58437
Modified:
sandbox/trunk/import_in_py/Py3K/tests/mock_importlib.py
sandbox/trunk/import_in_py/Py3K/tests/test_fs_loader.py
Log:
Fix some tests to move over newly exposed functions in marshal.
Modified: sandbox/trunk/import_in_py/Py3K/tests/mock_importlib.py
==============================================================================
--- sandbox/trunk/import_in_py/Py3K/tests/mock_importlib.py (original)
+++ sandbox/trunk/import_in_py/Py3K/tests/mock_importlib.py Fri Oct 12 21:06:58 2007
@@ -1,8 +1,6 @@
import sys
-import marshal
import imp
from test import test_support
-from importlib import _w_long
def log_call(method):
Modified: sandbox/trunk/import_in_py/Py3K/tests/test_fs_loader.py
==============================================================================
--- sandbox/trunk/import_in_py/Py3K/tests/test_fs_loader.py (original)
+++ sandbox/trunk/import_in_py/Py3K/tests/test_fs_loader.py Fri Oct 12 21:06:58 2007
@@ -5,6 +5,7 @@
from tests.py_help import TestPyPycPackages
import imp
+import marshal
import os
import py_compile
import sys
@@ -251,10 +252,10 @@
log_call(loader, 'write_bytecode')
with open(self.pyc_path, 'rb') as bytecode_file:
data = bytecode_file.read()
- timestamp = importlib._r_long(data[4:8])
+ timestamp = marshal._r_long(data[4:8])
with open(self.pyc_path, 'wb') as bytecode_file:
bytecode_file.write(data[:4])
- bytecode_file.write(importlib._w_long(timestamp-1))
+ bytecode_file.write(marshal._w_long(timestamp-1))
bytecode_file.write(data[8:])
found = loader.load_module(self.module_name)
self.assert_('write_bytecode' in loader._log)
@@ -314,7 +315,7 @@
source_mtime = int(os.stat(self.py_path).st_mtime)
with open(self.pyc_path, 'wb') as bytecode_file:
bytecode_file.write(imp.get_magic())
- bytecode_file.write(importlib._w_long(source_mtime))
+ bytecode_file.write(marshal._w_long(source_mtime))
loader = importlib._PyFileLoader(self.module_name, self.py_path, False)
self.assertRaises(Exception, loader.load_module, self.module_name)
More information about the Python-checkins
mailing list