Skip to content

Commit

Permalink
Merge pull request #1629 from rstudio/fix-config-module-import
Browse files Browse the repository at this point in the history
Fix error when importing `config`
  • Loading branch information
t-kalinowski committed Jun 28, 2024
2 parents 9133fa3 + 4dd5319 commit 740169a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# reticulate (development version)

- Fixed error when importing a module named `config` (#1628)

# reticulate 1.38.0

- Python Exceptions converted to R conditions are now R lists instead
Expand Down
4 changes: 3 additions & 1 deletion inst/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def module_path(name):

# Get appropriate path-entry separator for platform
pathsep = ";" if os.name == "nt" else ":"
this_script_dir = os.path.dirname(__file__)

# Read default configuration values
# fmt: off
Expand All @@ -43,7 +44,8 @@ def module_path(name):
"Prefix" : getattr(sys, "prefix", ""),
"ExecPrefix" : getattr(sys, "exec_prefix", ""),
"BaseExecPrefix" : getattr(sys, "base_exec_prefix", ""),
"PythonPath" : pathsep.join((x or "." for x in sys.path)),
"PythonPath" : pathsep.join((x or "." for x in sys.path
if x != this_script_dir)),
"LIBPL" : sysconfig.get_config_var("LIBPL"),
"LIBDIR" : sysconfig.get_config_var("LIBDIR"),
"SharedLibrary" : sysconfig.get_config_var("Py_ENABLE_SHARED"),
Expand Down

0 comments on commit 740169a

Please sign in to comment.