Skip to content

Commit

Permalink
Prevent using mutable objects as default params.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Feb 1, 2017
1 parent a237d6a commit 116230b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/RestrictedPython/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ def new_print_scope(self):

class RestrictingNodeTransformer(ast.NodeTransformer):

def __init__(self, errors=[], warnings=[], used_names=[]):
def __init__(self, errors=None, warnings=None, used_names=None):
super(RestrictingNodeTransformer, self).__init__()
self.errors = errors
self.warnings = warnings
self.used_names = used_names
self.errors = [] if errors is None else errors
self.warnings = [] if warnings is None else warnings
self.used_names = [] if used_names is None else used_names

# Global counter to construct temporary variable names.
self._tmp_idx = 0
Expand Down

0 comments on commit 116230b

Please sign in to comment.