mirror of https://github.com/n1nj4sec/pupy.git
pyexec module arguments fix
This commit is contained in:
parent
ce5a3e8d17
commit
de4b0a051f
|
@ -3,6 +3,7 @@
|
||||||
# Pupy is under the BSD 3-Clause license. see the LICENSE file at the root of the project for the detailed licence terms
|
# Pupy is under the BSD 3-Clause license. see the LICENSE file at the root of the project for the detailed licence terms
|
||||||
from pupylib.PupyModule import *
|
from pupylib.PupyModule import *
|
||||||
from pupylib.PupyCompleter import *
|
from pupylib.PupyCompleter import *
|
||||||
|
from pupylib.PupyErrors import *
|
||||||
import StringIO
|
import StringIO
|
||||||
from pupylib.utils.rpyc_utils import redirected_stdo
|
from pupylib.utils.rpyc_utils import redirected_stdo
|
||||||
|
|
||||||
|
@ -21,8 +22,10 @@ class PythonExec(PupyModule):
|
||||||
self.info("loading code from %s ..."%args.file)
|
self.info("loading code from %s ..."%args.file)
|
||||||
with open(args.file,'r') as f:
|
with open(args.file,'r') as f:
|
||||||
code=f.read()
|
code=f.read()
|
||||||
else:
|
elif args.code:
|
||||||
code=args.code
|
code=args.code
|
||||||
|
else:
|
||||||
|
raise PupyModuleError("--code or --file argument is mandatory")
|
||||||
stdout=StringIO.StringIO()
|
stdout=StringIO.StringIO()
|
||||||
stderr=StringIO.StringIO()
|
stderr=StringIO.StringIO()
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue