Remove adding force to builtins (#1535)

This commit is contained in:
James Lu 2023-06-04 19:07:14 -07:00 committed by Val Lorentz
parent 9fceb85c41
commit bc852379f5
2 changed files with 1 additions and 8 deletions

View File

@ -48,19 +48,12 @@ def split(s):
csv.join = join
csv.split = split
builtins = (__builtins__ if isinstance(__builtins__, dict) else __builtins__.__dict__)
# We use this often enough that we're going to stick it in builtins.
def force(x):
if callable(x):
return x()
else:
return x
builtins['force'] = force
# These imports need to happen below the block above, so things get put into
# __builtins__ appropriately.
from .gen import *
from . import crypt, error, file, iter, net, python, seq, str, time, transaction, web

View File

@ -36,7 +36,7 @@ import random
import shutil
import os.path
from . import crypt
from . import crypt, force
def sanitizeName(filename):
"""Removes / from filenames and escapes them if they are '.' or '..'."""