Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
3b622389
Commit
3b622389
authored
Sep 28, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
give all FS subclasses a "close" method
parent
a34a46b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
fs/base.py
+7
-0
No files found.
fs/base.py
View file @
3b622389
...
@@ -154,11 +154,18 @@ class FS(object):
...
@@ -154,11 +154,18 @@ class FS(object):
thread_synconize -- If True, a lock object will be created for the
thread_synconize -- If True, a lock object will be created for the
object, otherwise a dummy lock will be used.
object, otherwise a dummy lock will be used.
"""
"""
self
.
closed
=
False
if
thread_synchronize
:
if
thread_synchronize
:
self
.
_lock
=
threading
.
RLock
()
self
.
_lock
=
threading
.
RLock
()
else
:
else
:
self
.
_lock
=
DummyLock
()
self
.
_lock
=
DummyLock
()
def
__del__
(
self
):
if
not
self
.
closed
:
self
.
close
()
def
close
(
self
):
self
.
closed
=
True
def
__getstate__
(
self
):
def
__getstate__
(
self
):
# Locks can't be pickled, so instead we just indicate the
# Locks can't be pickled, so instead we just indicate the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment