Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f0e3daa

Browse filesBrowse files
authored
Merge pull request python-gitlab#838 from python-gitlab/pickle-fix
fix: improve pickle support
2 parents 8d54cf5 + b4b5dec commit f0e3daa
Copy full SHA for f0e3daa

File tree

Expand file treeCollapse file tree

2 files changed

+2
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-1
lines changed
Open diff view settings
Collapse file

‎gitlab/base.py‎

Copy file name to clipboardExpand all lines: gitlab/base.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __getstate__(self):
5252
def __setstate__(self, state):
5353
module_name = state.pop("_module_name")
5454
self.__dict__.update(state)
55-
self._module = importlib.import_module(module_name)
55+
self.__dict__["_module"] = importlib.import_module(module_name)
5656

5757
def __getattr__(self, name):
5858
try:
Collapse file

‎gitlab/tests/test_base.py‎

Copy file name to clipboardExpand all lines: gitlab/tests/test_base.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def test_pickability(self):
9393
self.assertIsInstance(unpickled, FakeObject)
9494
self.assertTrue(hasattr(unpickled, "_module"))
9595
self.assertEqual(unpickled._module, original_obj_module)
96+
pickled2 = pickle.dumps(unpickled)
9697

9798
def test_attrs(self):
9899
obj = FakeObject(self.manager, {"foo": "bar"})

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.