#16066: Python 3 preparation: Handle removed execfile() function
----------------------------+----------------------------
   Reporter:  wluebbe       |            Owner:
       Type:  enhancement   |           Status:  new
   Priority:  major         |        Milestone:  sage-6.2
  Component:  distribution  |         Keywords:  python3
  Merged in:                |          Authors:
  Reviewers:                |  Report Upstream:  N/A
Work issues:                |           Branch:
     Commit:                |     Dependencies:
   Stopgaps:                |
----------------------------+----------------------------
 In Py2 there is the
 [[https://docs.python.org/2.7/library/functions.html#execfile|execfile()
 function]], while in Py3 there is none.

 The tool 2to3 changes the  calls to execfile() to wrapped calls of the
 builtin {{{open()}}}, {{{compile}}} and {{{exec()}}} functions.
 An example of a change {{{lib2to3/fixes/fix_execfile.py}}} is
 {{{
 -        execfile(fpath, globals)
 +        exec(compile(open(fpath).read(), fpath, 'exec'), globals)
 }}}
 There are 2 occurences of execfile() in {{{sage/misc/preparser.py}}}.
 [[br]]
 The code has to depend on the Python version!

 This ticket is tracked as a dependency of meta-ticket ticket:16052.

--
Ticket URL: <http://trac.sagemath.org/ticket/16066>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to