~ubuntu-branches/debian/sid/bandit/sid

« back to all changes in this revision

Viewing changes to examples/eval.py

  • Committer: Package Import Robot
  • Author(s): Dave Walker (Daviey)
  • Date: 2015-07-22 09:01:39 UTC
  • Revision ID: package-import@ubuntu.com-20150722090139-fl0nluy0x8m9ctx4
Tags: upstream-0.12.0
ImportĀ upstreamĀ versionĀ 0.12.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
 
 
3
print(eval("1+1"))
 
4
print(eval("os.getcwd()"))
 
5
print(eval("os.chmod('%s', 0777)" % 'test.txt'))
 
6
 
 
7
 
 
8
# A user-defined method named "eval" should not get flagged.
 
9
class Test(object):
 
10
    def eval(self):
 
11
        print("hi")
 
12
    def foo(self):
 
13
        self.eval()
 
14
 
 
15
Test().eval()