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 b84d373 commit c91e8e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/testPythonScript.py
Expand Up @@ -231,8 +231,9 @@ def testSubversiveExcept(self):
self.assertPSRaises(SyntaxError, path='subversive_except')

def testBadImports(self):
self.assertPSRaises(ImportError, body="from string import *")
self.assertPSRaises(ImportError, body="import mmap")
from zExceptions import Unauthorized
self.assertPSRaises(Unauthorized, body="from string import *")
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 c91e8e7

Please sign in to comment.