Skip to content

Commit

Permalink
Remove adding force to builtins (#1535)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlu5 authored and progval committed Jul 17, 2024
1 parent 9fceb85 commit bc85237
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions src/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
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 '..'."""
Expand Down

0 comments on commit bc85237

Please sign in to comment.