Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
975352b0
Unverified
Commit
975352b0
authored
4 years ago
by
Awais Qureshi
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #24240 from eduNEXT/lmm/re_py38
[BD-6] Fix python 3.8 compatibility
parents
47c0f3de
398a8a2b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/modulestore/__init__.py
+7
-1
7 additions, 1 deletion
common/lib/xmodule/xmodule/modulestore/__init__.py
with
7 additions
and
1 deletion
common/lib/xmodule/xmodule/modulestore/__init__.py
+
7
−
1
View file @
975352b0
...
@@ -32,6 +32,12 @@ from xmodule.errortracker import make_error_tracker
...
@@ -32,6 +32,12 @@ from xmodule.errortracker import make_error_tracker
from
.exceptions
import
InsufficientSpecificationError
,
InvalidLocationError
from
.exceptions
import
InsufficientSpecificationError
,
InvalidLocationError
# The name of the type for patterns in re changed in Python 3.7.
try
:
Pattern
=
re
.
_pattern_type
# pylint: disable=protected-access
except
AttributeError
:
Pattern
=
re
.
Pattern
# pylint: disable=no-member
log
=
logging
.
getLogger
(
'
edx.modulestore
'
)
log
=
logging
.
getLogger
(
'
edx.modulestore
'
)
new_contract
(
'
CourseKey
'
,
CourseKey
)
new_contract
(
'
CourseKey
'
,
CourseKey
)
...
@@ -899,7 +905,7 @@ class ModuleStoreRead(six.with_metaclass(ABCMeta, ModuleStoreAssetBase)):
...
@@ -899,7 +905,7 @@ class ModuleStoreRead(six.with_metaclass(ABCMeta, ModuleStoreAssetBase)):
"""
"""
if
isinstance
(
target
,
list
):
if
isinstance
(
target
,
list
):
return
any
(
self
.
_value_matches
(
ele
,
criteria
)
for
ele
in
target
)
return
any
(
self
.
_value_matches
(
ele
,
criteria
)
for
ele
in
target
)
elif
isinstance
(
criteria
,
re
.
_p
attern
_type
):
# pylint: disable=protected-access
elif
isinstance
(
criteria
,
P
attern
):
return
criteria
.
search
(
target
)
is
not
None
return
criteria
.
search
(
target
)
is
not
None
elif
callable
(
criteria
):
elif
callable
(
criteria
):
return
criteria
(
target
)
return
criteria
(
target
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment