Skip to content

Commit c176cf7

Browse files
committed
Avoid mutating schema argument
Closes #87 (eventually...)
1 parent 4123b3d commit c176cf7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/hypothesis_jsonschema/_from_schema.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import operator
66
import re
77
import warnings
8+
from copy import deepcopy
89
from fractions import Fraction
910
from functools import partial
1011
from typing import Any, Callable, Dict, List, NoReturn, Optional, Set, Union
@@ -135,7 +136,7 @@ def from_schema(
135136
"""
136137
try:
137138
return __from_schema(
138-
schema,
139+
deepcopy(schema),
139140
custom_formats=custom_formats,
140141
alphabet=CharStrategy.from_args(allow_x00=allow_x00, codec=codec),
141142
)

0 commit comments

Comments
 (0)