Ticket #5908: patch5908.patch

File patch5908.patch, 1.0 KB (added by Petit_Dejeuner, 21 months ago)

Replaces call to 'eval()' with call to 'int(var, 8)'.

  • twisted/test/test_paths.py

    Only in Twisted-Eval: build
    Only in Twisted-Eval/twisted: __init__.pyc
    Only in Twisted-Eval/twisted: _version.pyc
    Only in Twisted-Eval/twisted: copyright.pyc
    Only in Twisted-Eval/twisted/python: __init__.pyc
    Only in Twisted-Eval/twisted/python: compat.pyc
    Only in Twisted-Eval/twisted/python: dist.pyc
    Only in Twisted-Eval/twisted/python: versions.pyc
    diff -ur Twisted/twisted/test/test_paths.py Twisted-Eval/twisted/test/test_paths.py
    old new  
    561561        for u in range(0, 8): 
    562562            for g in range(0, 8): 
    563563                for o in range(0, 8): 
    564                     perm = filepath.Permissions(eval("0o%d%d%d" % (u, g, o))) 
     564                    perm = filepath.Permissions(int("0o%d%d%d" % (u, g, o), 8)) 
    565565                    self.assertEqual(perm.shorthand(), 
    566566                                      ''.join(x.shorthand() for x in ( 
    567567                                          perm.user, perm.group, perm.other)))