Commit 6d1a19df authored by Fred Drake's avatar Fred Drake

- delay import of the rotor module; this avoids deprecation warnings

  when it isn't actually used (like in the unit tests...)
parent a03786ac
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
# on restart if there is still a product directory. # on restart if there is still a product directory.
import os, re, zlib, marshal, rotor, cPickle import os, re, zlib, marshal, cPickle
from cgi import escape from cgi import escape
from urllib import quote from urllib import quote
...@@ -197,6 +197,7 @@ class Product(Folder, PermissionManager): ...@@ -197,6 +197,7 @@ class Product(Folder, PermissionManager):
id=self.id id=self.id
import rotor
import tar import tar
rot=rotor.newrotor(id+' shshsh') rot=rotor.newrotor(id+' shshsh')
ar=tar.tgzarchive("%s-%s" % (id, self.version)) ar=tar.tgzarchive("%s-%s" % (id, self.version))
...@@ -437,7 +438,9 @@ class CompressedInputFile: ...@@ -437,7 +438,9 @@ class CompressedInputFile:
def __init__(self, f, rot): def __init__(self, f, rot):
self._c=zlib.decompressobj() self._c=zlib.decompressobj()
self._b='' self._b=''
if type(rot) is type(''): rot=rotor.newrotor(rot) if isinstance(rot, str):
import rotor
rot=rotor.newrotor(rot)
self._rot=rot self._rot=rot
rot.decrypt('') rot.decrypt('')
self._f=f self._f=f
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment