Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BlenderPhi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
raas
BlenderPhi
Commits
41bfb62b
Commit
41bfb62b
authored
12 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
was trying to make py import follow pythons own code more but broke py32 compat. this should fix
parent
48f968ed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/blender/python/generic/bpy_internal_import.c
+4
-5
4 additions, 5 deletions
source/blender/python/generic/bpy_internal_import.c
with
4 additions
and
5 deletions
source/blender/python/generic/bpy_internal_import.c
+
4
−
5
View file @
41bfb62b
...
...
@@ -257,8 +257,7 @@ PyObject *bpy_text_reimport(PyObject *module, int *found)
static
PyObject
*
blender_import
(
PyObject
*
UNUSED
(
self
),
PyObject
*
args
,
PyObject
*
kw
)
{
PyObject
*
exception
,
*
err
,
*
tb
;
//char *name;
PyObject
*
name
;
char
*
name
;
int
found
=
0
;
PyObject
*
globals
=
NULL
,
*
locals
=
NULL
,
*
fromlist
=
NULL
;
int
level
=
0
;
/* relative imports */
...
...
@@ -267,14 +266,14 @@ static PyObject *blender_import(PyObject *UNUSED(self), PyObject *args, PyObject
//PyObject_Print(args, stderr, 0);
static
const
char
*
kwlist
[]
=
{
"name"
,
"globals"
,
"locals"
,
"fromlist"
,
"level"
,
NULL
};
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kw
,
"
U
|OOOi:bpy_import_meth"
,
(
char
**
)
kwlist
,
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kw
,
"
s
|OOOi:bpy_import_meth"
,
(
char
**
)
kwlist
,
&
name
,
&
globals
,
&
locals
,
&
fromlist
,
&
level
))
{
return
NULL
;
}
/* import existing builtin modules or modules that have been imported already */
newmodule
=
PyImport_ImportModuleLevel
Object
(
name
,
globals
,
locals
,
fromlist
,
level
);
newmodule
=
PyImport_ImportModuleLevel
(
name
,
globals
,
locals
,
fromlist
,
level
);
if
(
newmodule
)
return
newmodule
;
...
...
@@ -282,7 +281,7 @@ static PyObject *blender_import(PyObject *UNUSED(self), PyObject *args, PyObject
PyErr_Fetch
(
&
exception
,
&
err
,
&
tb
);
/* get the python error in case we cant import as blender text either */
/* importing from existing modules failed, see if we have this module as blender text */
newmodule
=
bpy_text_import_name
(
_PyUnicode_AsString
(
name
)
,
&
found
);
newmodule
=
bpy_text_import_name
(
name
,
&
found
);
if
(
newmodule
)
{
/* found module as blender text, ignore above exception */
PyErr_Clear
();
...
...
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