Skip to content

Commit

Permalink
LP #281156: 'AccessControl.SecurityInfo.secureModule' dropped ModuleS…
Browse files Browse the repository at this point in the history
…ecurity

for failed imports, obscuring later attempts to import the same broken module.

'AccessControl.ZopeGuards.guarded_import' mapped some Unauthorized exceptions
onto ImportErrors:  don't do that!  Also, removed mutable defaults from
argument list, improved tests.
  • Loading branch information
tseaver committed Oct 10, 2008
1 parent 87280a5 commit b694d5a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/testPythonScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,10 @@ def testSubversiveExcept(self):
self.assertPSRaises(SyntaxError, path='subversive_except')

def testBadImports(self):
self.assertPSRaises(ImportError, body="from string import *")
self.assertPSRaises(ImportError, body="from datetime import datetime")
#self.assertPSRaises(ImportError, body="import mmap")
from zExceptions import Unauthorized
self.assertPSRaises(Unauthorized, body="from string import *")
self.assertPSRaises(Unauthorized, body="from datetime import datetime")
self.assertPSRaises(Unauthorized, body="import mmap")

def testAttributeAssignment(self):
# It's illegal to assign to attributes of anything that
Expand Down

0 comments on commit b694d5a

Please sign in to comment.